Closed Bug 1414783 Opened 7 years ago Closed 7 years ago

window object in content script of WebExtension is reset if document.domain is set explicitly

Categories

(WebExtensions :: General, defect)

58 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1408996

People

(Reporter: gera2ld, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36 Steps to reproduce: 1. create an HTML file with script below in it, let's say `test.html`: ```js <script> // document.domain = 'parent.domain'; // or even this will cause the issue document.domain = document.domain; </script> ``` 2. create a WebExtension with content script below: ```js window.aaa = 1; const aaa = window.aaa; setTimeout(() => { console.log(aaa, window.aaa); }, 1000); ``` 3. enable the WebExtension, visit the HTML with an HTTP server, local server works (e.g http://localhost:8080/test.html), and see the logs in console. Actual results: With `document.domain` set explicitly, I got `1 undefined` in console. Without that I got `1 1`. Expected results: It should always be `1 1`. By doing a few tests, I found that the window object seems to be reset with all values on it lost. But the window object is still the original object (windowBefore === windowAfter).
This can be reproduced in Firefox 56 / 57 / 58.
Component: Untriaged → WebExtensions: General
Product: Firefox → Toolkit
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.