Created
December 12, 2019 23:23
-
-
Save samwilson/9dc005fa5e4fe38f0eb4c65ec6609755 to your computer and use it in GitHub Desktop.
ResourceLoader queue weirdness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log( 'Start of content_script.js' ); | |
const script = document.createElement( 'script' ), | |
body = document.getElementsByTagName( 'body' )[ 0 ]; | |
script.src = browser.extension.getURL( 'injected_script.js' ); | |
body.appendChild( script ); | |
console.log( 'End of content_script.js' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('About to add to RLQ'); | |
(RLQ = window.RLQ || []) | |
.push( [ [ 'mediawiki.base' ], () => { | |
console.log('Loaded with RL dependencies'); | |
mw.notify( 'This is a notification.' ); | |
} ] ); | |
console.log('Finished adding to RLQ'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"manifest_version": 2, | |
"name": "WWT bug", | |
"description": "", | |
"author": "Sam Wilson", | |
"homepage_url": "https://example.com/", | |
"version": "0.1.0.0", | |
"browser_specific_settings": { | |
"gecko": { | |
"id": "wwt-test@wikimedia" | |
} | |
}, | |
"content_scripts": [ { | |
"matches": [ | |
"*://*.wikipedia.org/*" | |
], | |
"js": [ "content_script.js" ] | |
} ], | |
"web_accessible_resources": [ "injected_script.js" ], | |
"permissions": [ "tabs", "activeTab", "storage" ] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment