forked from thingsinjars/devtools-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
panel.js
18 lines (15 loc) · 794 Bytes
/
panel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// This one acts in the context of the panel in the Dev Tools
//
// Can use
// chrome.devtools.*
// chrome.extension.*
document.querySelector('#executescript').addEventListener('click', function() {
sendObjectToInspectedPage({action: "code", content: "console.log('Inline script executed')"});
}, false);
document.querySelector('#insertscript').addEventListener('click', function() {
sendObjectToInspectedPage({action: "script", content: "inserted-script.js"});
}, false);
document.querySelector('#insertmessagebutton').addEventListener('click', function() {
sendObjectToInspectedPage({action: "code", content: "document.body.innerHTML='<button>Send message to DevTools</button>'"});
sendObjectToInspectedPage({action: "script", content: "messageback-script.js"});
}, false);