Created
July 24, 2014 15:37
-
-
Save akiyoshi83/3ddd4f1093853659864f to your computer and use it in GitHub Desktop.
addon-test01
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
// require | |
const self = require("sdk/self"); | |
const data = self.data; | |
const addonPage = require("sdk/addon-page"); | |
const frameUtils = require('sdk/frame/utils'); | |
const tabs = require("sdk/tabs"); | |
const widget = require('sdk/widget'); | |
const windowUtils = require('sdk/window/utils'); | |
const windows = require("sdk/windows").browserWindows; | |
// widget | |
let myWidget = widget.Widget({ | |
id: "mozilla-icon", | |
label: "addon-frame-test", | |
contentURL: "http://www.mozilla.org/favicon.ico", | |
onClick: function () { | |
console.log("icon click"); | |
init(); | |
} | |
}); | |
function init() { | |
// addon page | |
//tabs.open(data.url("addon-page.html")); | |
let page = windows.open(data.url("addon-page.html")); | |
// frame | |
let curWindow = windowUtils.getMostRecentBrowserWindow(); | |
let _frame = frameUtils.create(curWindow.document, { | |
//uri: 'data:text/html,<script>alert("Hello")</script>', | |
uri: data.url('frame.html'), | |
allowJavascript: true | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment