Closed Bug 1389241 Opened 7 years ago Closed 3 years ago

Firefox breaks site "inbox.google.com" because it incorrectly handles "match_about_blank": true used by Stylus Addon content script (even if content script is empty, Stylus Addon code is not the culprit).

Categories

(WebExtensions :: Compatibility, defect, P5)

57 Branch
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: luke.mele, Unassigned)

Details

Attachments

(3 files)

Attached image screenshot.jpg
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0 Build ID: 20170810100255 Steps to reproduce: Firefox Nightly 57.0a1 and Firefox 55 Windows 10 Stylus v1.1.3.1 Stylus enabled Stylus enabled-Userstyles disabled Actual results: Firefox Nightly 57.0a1 and Firefox 55 URL: inbox.google.com Stylus enabled: Multi emails from the same sender will not open when clicking on them Stylus enabled-Userstyles disabled: Multi emails from the same sender will not open when clicking on them Expected results: Firefox Nightly 57.0a1 and Firefox 55 URL: inbox.google.com Stylus disabled: Normal Function-Can click on multi emails and open See attached
Summary: Firefox: inbox.google.com is broken - can't open emails from same sender "match_about_blank: true" caused Stylus Addon to break functionality → Firefox breaks site "inbox.google.com" because it incorrectly handles "match_about_blank": true used by Stylus Addon content script (even if content script is empty, Stylus Addon code is not the culprit).
Component: Untriaged → WebExtensions: General
Product: Firefox → Toolkit
Another problem here caused by "all_frames": true Direct link to the Issue with more information: https://github.com/openstyles/stylus/issues/100 Regards !
Component: WebExtensions: General → WebExtensions: Compatibility
Flags: needinfo?(amckay)
Priority: -- → P5
Sorry, could you try and detail what the problem with the implementation of all_frames (comment 1) is and how that relates to match_about_blank (title)? Or perhaps a simple demonstration of the problem?
Flags: needinfo?(amckay)
Uhm, not sure why this wasn't fixed *ages* ago to match Chrome API where it has been working without any problems for years, but if you need a simplified repro, here it goes (sorry, I cannot attach files to my message on this weird bugtracker): manifest.json: { "name": "test", "version": "0.0.1", "manifest_version": 2, "description": ".............", "content_scripts": [{ "matches": ["<all_urls>"], "run_at": "document_start", "all_frames": true, "match_about_blank": true, "js": ["content.js"] }] } content.js console.log('RUNNING IN', location.href); if (window !== top && location.href === 'about:blank') { setTimeout(() => { alert('SUCCESS'); document.body.insertAdjacentHTML('afterbegin', '<p>Running in a dynamically added about:blank iframe'); }); } test.html - open it locally or via a simple http server as http://localhost/test.html <head><meta charset="UTF-8"></head> <body> <script> document.body.appendChild(document.createElement('iframe')).style.cssText = 'width:100%; height:50vh;'; </script> </body> EXPECTED: 1. "SUCCESS" is shown in a js alert dialog, the iframe displays "Running in a dynamically added about:blank iframe" 2. devtools console displays something like the following: RUNNING IN http://localhost/test.html RUNNING IN about:blank OBSERVED: nothing, no content script runs in the iframe
*note: disregard <p> not being closed in insertAdjacentHTML above as it doesn't alter the outcome in any way.
Product: Toolkit → WebExtensions
According to https://github.com/openstyles/stylus/issues/100 this has been fixed. Can you please confirm whether this issue is still present?
Flags: needinfo?(luke.mele)
The above simplified repro I've added 9 months ago still shows it's not fixed in FF. The issue in Stylus probably says the site problem was fixed, not the underlying bug reported here.
(In reply to wOxxOm from comment #6) > The above simplified repro I've added 9 months ago still shows it's not > fixed in FF. I have tested your example in Firefox 55, 61 and 63 on Linux (with and without e10s) and in all cases I get the expected dialog. If you are able to reproduce the bug with your test case, please take a look at the console and see if document.body is non-null.
In Windows, with the simplified repro above I can reproduce the bug in 63, 62, 61, 60 as well as those versions at the time of adding the repro 9 months ago so I guess everything in between goes too. I'm using a blank new user profile so all settings are at their default values. If I look at the console I see only "RUNNING IN http://localhost/test.html" which means the content script runs only in the main page, but not in the iframe. Not sure how document.body is related, but it's null when the content script runs at document_start as it should be. Surprisingly, in FF 52 it's not null, and the bug is not observed in FF52 in a new default profile.
More on document.body. I've added document.body to the first console.log which is executed at document_start. FF 20170415030205 RUNNING IN file:///R:/test.html null RUNNING IN about:blank <body> FF 20170416030209 and newer RUNNING IN file:///R:/test.html null Chrome since 2014 thanks to your http://crrev.com/270690 RUNNING IN file:///R:/test.html null RUNNING IN about:blank null
I am getting the expected results. I followed the following steps: 1. Installed the latest version of Firefox (61.0.1, build ID 20180704003137 according to about:support) in Windows 10 (from a VM from modern.ie). 2. Visit about:debugging and load the extension from comment 3 (zipped). 3. Visit test.html at localhost (a simple Node.js file server) (I also tried a file://-URL). I observed that the SUCCESS message was displayed as expected. Your regression range in comment 9 is quite large, and includes a large refactor (bug 1317697). Unfortunately, without consistent reproduction steps, it is a bit difficult to find the culprit. Do you see any errors in the console? Could you atatach the exact extension that you are using, in case there are differences? You can attach a file via the "Attach file" link at the top of the issue.
Attached file test extension for #c3
Attached file test.html for #c3
1. Windows 7 2. about:debugging, load the extension from #c3 3. open test.html from #c3 in a new tab No SUCCESS message. No errors in the tab console. Note, reloading the extension will produce SUCCESS message. Browser toolbox console in FF63: Bootstrapped manifest not allowed to use 'resource' directive. chrome.manifest:1 Bootstrapped manifest not allowed to use 'resource' directive. chrome.manifest:7 Bootstrapped manifest not allowed to use 'resource' directive. chrome.manifest:2 Content Security Policy: Directive ‘child-src’ has been deprecated. Please use directive ‘worker-src’ to control workers, or directive ‘frame-src’ to control frames respectively. Use of nsIFile in content process is deprecated. NetUtil.jsm:266:12 Key event not available on some keyboard layouts: key=“i” modifiers=“accel,alt,shift” id=“key_browserToolbox” browser.xul P.S. added the attachments.
I managed to reproduce in Firefox 61.0.1 on Linux and Windows (also with the original extension in comment 11), but only if: - I open test.html as a local file (file:). - I open the devtools before (re)loading test.html Does your reproduction also require these conditions?
Flags: needinfo?(luke.mele)
No, I don't do anything except what is mentioned in STR. I can also repro in 64-bit versions of FF and with http://localhost/test.html
Also when using "web-ext run" inside the extension directory. Just in case, the computer speed is not an issue: SSD drive, 32GB memory, and i7 CPU at 4GHz.

Is this bug still relevant since Inbox is no longer active or can it be closed by now

Flags: needinfo?(woxxom)
Flags: needinfo?(rob)

Can't reproduce the reduced test case in the latest Firefox version (96). Closing.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(rob)
Resolution: --- → WORKSFORME
Flags: needinfo?(woxxom)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: