Merge lp:~uriboni/webbrowser-app/facebook-banner into lp:webbrowser-app

Proposed by Ugo Riboni on 2015-10-29
Status: Merged
Approved by: Olivier Tilloy on 2015-10-29
Approved revision: 1259
Merged at revision: 1266
Proposed branch: lp:~uriboni/webbrowser-app/facebook-banner
Merge into: lp:webbrowser-app
Diff against target: 29 lines (+11/-5)
1 file modified
src/Ubuntu/Web/fb-no-appbanner.js (+11/-5)
To merge this branch: bzr merge lp:~uriboni/webbrowser-app/facebook-banner
Reviewer Review Type Date Requested Status
Olivier Tilloy 2015-10-29 Approve on 2015-10-29
PS Jenkins bot continuous-integration Approve on 2015-10-29
Review via email: mp+276108@code.launchpad.net

Commit message

Update the user script to remove the Facebook app banner.

Description of the change

Update the user script to remove the Facebook app banner

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Web/fb-no-appbanner.js'
2--- src/Ubuntu/Web/fb-no-appbanner.js 2014-07-07 11:14:33 +0000
3+++ src/Ubuntu/Web/fb-no-appbanner.js 2015-11-02 16:54:12 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright 2014 Canonical Ltd.
7+ * Copyright 2014-2015 Canonical Ltd.
8 *
9 * This file is part of webbrowser-app.
10 *
11@@ -24,8 +24,14 @@
12 // suggests installing a native Android/iOS application based on naïve
13 // parsing of the UA string.
14
15-var r = document.getElementsByClassName("appBanner");
16-if (r.length === 1) {
17- var appbanner = r[0];
18- appbanner.parentNode.removeChild(appbanner);
19+// The banner does not currently have any class or id that would make sure we
20+// can identify it easily. But we know that it does always appear just before
21+// the login form, so we find it that way.
22+
23+var login = document.getElementsByClassName("mobile-login-form");
24+if (login.length === 1) {
25+ var appbanner = login[0].previousSibling;
26+ if (appbanner) {
27+ appbanner.parentNode.removeChild(appbanner);
28+ }
29 }

Subscribers

People subscribed via source and target branches

to status/vote changes: