Last active
August 29, 2015 14:09
-
-
Save lkuper/2bb60be77b609c505c2a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| function hello(name) { | |
| console.log("Hello from privileged code, " + name + "!"); | |
| } | |
| Components.utils.exportFunction(hello, unsafeWindow, {defineAs: "hello"}); |
This file contains hidden or 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
| const {Cu} = require("chrome"); | |
| var pageMod = require("sdk/page-mod"); | |
| var data = require("sdk/self").data; | |
| pageMod.PageMod({ | |
| include: "*", | |
| attachTo: ["existing", "top"], | |
| contentScriptFile: data.url("content.js"), | |
| contentScriptWhen: "start", // Attach the content script before any page script loads. | |
| }); |
This file contains hidden or 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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
| <title>Test page</title> | |
| </head> | |
| <body> | |
| <script type="text/javascript"> | |
| hello("Lindsey"); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment