mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 06:48:37 +02:00
Hellosct1 webext (#237)
* README.md 1st commit * New demo with devtools and the webextensions * evolution script example * Remove commented out code, to see if it triggers a Travis build * Updated README; added more descriptive labels for buttons * Added some comments * update evolution * correction * correction next * correction next * update script for jquery * update part jquery in the devtools * Remove jQuery check from handleResult
This commit is contained in:
24
devtools-panels/devtools/devtools.js
Normal file
24
devtools-panels/devtools/devtools.js
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
This script is run whenever the devtools are open.
|
||||
In here, we can create our panel.
|
||||
*/
|
||||
|
||||
function handleShown() {
|
||||
console.log("panel is being shown");
|
||||
}
|
||||
|
||||
function handleHidden() {
|
||||
console.log("panel is being hidden");
|
||||
}
|
||||
|
||||
/**
|
||||
Create a panel, and add listeners for panel show/hide events.
|
||||
*/
|
||||
browser.devtools.panels.create(
|
||||
"My Panel",
|
||||
"icons/star.png",
|
||||
"devtools/panel/panel.html"
|
||||
).then((newPanel) => {
|
||||
newPanel.onShown.addListener(handleShown);
|
||||
newPanel.onHidden.addListener(handleHidden);
|
||||
});
|
||||
Reference in New Issue
Block a user