Closed
Bug 1396605
Opened 7 years ago
Closed 7 years ago
Two pageAction.show API calls may create two PageAction icons
Categories
(WebExtensions :: Android, defect, P1)
Tracking
(firefox55 unaffected, firefox56 unaffected, firefox57 verified)
VERIFIED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox55 | --- | unaffected |
firefox56 | --- | unaffected |
firefox57 | --- | verified |
People
(Reporter: cbadescu, Assigned: rpl)
References
Details
Attachments
(3 files)
[Affected versions]: - Firefox 57.0a1 (2017-09-03) [Affected platforms]: - Android 7.1.2 [Prerequisites] - set xpinstall.signatures.dev-root to true - set extensions.webapi.testing to true - set xpinstall.signatures.required to false [Steps to reproduce]: 1.Install https://addons-dev.allizom.org/en-US/firefox/addon/instagram-image-downloader/?src=search 2.Go to a page with multiple videos/photos for example https://www.instagram.com/luissuarez9/ 3.Select a video/photo [Expected results]: - One icon is displayed in the web page. [Actual results]: - Two icons are displayed in the web page. - One icon will be displayed permanently in the web page if you navigate from instagram web page to other addresses. - After uninstalling the extension, the icon will not be visible only if you restart/close the Fennec.
Assignee | ||
Comment 1•7 years ago
|
||
Ah, Finally I'm able to reproduce it locally and dig into this issue a bit more. Thanks a lot for fighting this long "find an STR which is able to reproduce this issue consistently" battle! Now that I've been able to reproduce the issue locally, I think that the page with multiple videos may not directly related to the issue, but for sure it is related to a race condition in the pageAction.show API call implementation on Android (which is probably more likely to be happen on a faster emulator, like using the x86 android emulator version). Follows some additional details about this issue: - Internally the `browser.pageAction.show` API method implementation on Android, calls the `PageAction.setProperty` method, which internally calls `PageAction.show` if the value of the "show" property received is "true" and `this.id` is still null in the PageAction instance: http://searchfox.org/mozilla-central/rev/999385a5e8c2d360cc37286882508075fc2078bd/mobile/android/components/extensions/ext-pageAction.js#120,123-125 - while a `PageAction.show` call is being handled, `this.id` can still be null if the icon is still loading http://searchfox.org/mozilla-central/rev/999385a5e8c2d360cc37286882508075fc2078bd/mobile/android/components/extensions/ext-pageAction.js#177 which basically means that two `browser.pageAction.show` API calls (when they happen in fast sequence) may request to the java bits the creation of two different PageAction icons. I'm going to attach a patch which prevents two `browser.pageAction.show` API calls to be able to send two different messages to the Java side of the PageAction icons implementation.
Assignee: nobody → lgreco
Status: NEW → ASSIGNED
Priority: -- → P1
Summary: Two icons displayed for a web page with multiples videos/photos → Two pageAction.show API calls may create two PageAction icons
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8904333 -
Flags: review?(mixedpuppy)
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8904333 [details] Bug 1396605 - Prevent duplicated Firefox for Android PageAction icons for a single extension. https://reviewboard.mozilla.org/r/176114/#review181108 ::: mobile/android/components/extensions/ext-pageAction.js:182 (Diff revision 1) > this.options.icon = dataURI; > this.id = PageActions.add(this.options); > } > }).catch(() => { > + // The "icon convertion" promise has been rejecte, set this.shouldShow to false > + // so that we are going to try again on the next pageAction.show call. conversion. rejected. s/are going to/will/
Attachment #8904333 -
Flags: review?(mixedpuppy) → review+
Comment hidden (mozreview-request) |
Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/76a7ead2334c Prevent duplicated Firefox for Android PageAction icons for a single extension. r=mixedpuppy
Comment 6•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/76a7ead2334c
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
This issue is verified as fixed on Fennec 57.0a1 (2017-09-08) under Android 6.0.1. One icon is displayed in the web page and there are no display or layout issues. Please see the attached video.
Status: RESOLVED → VERIFIED
Updated•6 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•