Skip to content

Instantly share code, notes, and snippets.



Last active Aug 29, 2015
What would you like to do?
function hello(name) {
console.log("Hello from privileged code, " + name + "!");
Components.utils.exportFunction(hello, unsafeWindow, {defineAs: "hello"});
const {Cu} = require("chrome");
var pageMod = require("sdk/page-mod");
var data = require("sdk/self").data;
include: "*",
attachTo: ["existing", "top"],
contentScriptFile: data.url("content.js"),
contentScriptWhen: "start", // Attach the content script before any page script loads.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="" xml:lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Test page</title>
<script type="text/javascript">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment