Closed Bug 1410642 Opened 7 years ago Closed 7 years ago

Async scripts from webextensions loaded on Facebook can't access global variables

Categories

(WebExtensions :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1408996

People

(Reporter: MR_1993, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Build ID: 20171003101344 Steps to reproduce: Load the attached extension, which loads 2 content scripts on any URL: content_script1.js: window.test = {"test": "test"}; content_script2:js window.addEventListener("DOMContentLoaded", function() { try { console.log(test.test); } catch (e) { console.log("Access failed:", e); } }); Open facebook.com, logged in. (The extension seems to work as expected on all other URLs). Actual results: The console logs "Access failed: ReferenceError: test is not defined". Expected results: The console should log "test". This issue affects Vimium-ff[0], specifically as (part of) [1], and so the extension doesn't work on Facebook for our Firefox users. [0]: https://addons.mozilla.org/en-US/firefox/addon/vimium-ff/ [1]: https://github.com/philc/vimium/issues/2675
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.

Attachment

General

Creator:
Created:
Updated:
Size: