Created
December 8, 2014 20:34
-
-
Save bwinton/54da2a0b4bf01d205039 to your computer and use it in GitHub Desktop.
How does this look to everyone?
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
| diff --git a/index.html b/index.html | |
| index d23efde..9bba611 100755 | |
| --- a/index.html | |
| +++ b/index.html | |
| @@ -36,5 +36,12 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. --> | |
| <script src="js/vendor/jquery/dist/jquery.min.js" charset="utf-8"></script> | |
| <script src="js/main.js"></script> | |
| + <script> | |
| + window.addEventListener("message", function (event) { | |
| + if (event.data === 'whimsy:enabled') { | |
| + console.log("Whimsy!", event.data); | |
| + } | |
| + }, false); | |
| + </script> | |
| </body> | |
| </html> |
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
| diff --git a/lib/main.js b/lib/main.js | |
| index 37df5e1..133734f 100644 | |
| --- a/lib/main.js | |
| +++ b/lib/main.js | |
| @@ -12,6 +12,7 @@ | |
| 'use strict'; | |
| +var pageMod = require('sdk/page-mod'); | |
| var prefs = require('sdk/simple-prefs'); | |
| var { Cu } = require('chrome'); | |
| Cu.import('resource://gre/modules/UITelemetry.jsm'); | |
| @@ -104,6 +105,11 @@ exports.main = function () { | |
| }); | |
| } | |
| + pageMod.PageMod({ | |
| + include: '*', | |
| + contentScript: 'window.postMessage("whimsy:enabled", "*")' | |
| + }); | |
| + | |
| }; | |
| exports.onUnload = function () { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ship it!