Yay a devtools!
This commit is contained in:
@@ -1,20 +1,12 @@
|
||||
console.log("content.js loaded", window.wrappedJSObject);
|
||||
|
||||
// setTimeout(() => {
|
||||
const getContextStack = () => window.wrappedJSObject.getContextStack();
|
||||
const updateContextValue = (key, value, depth) =>
|
||||
window.wrappedJSObject.updateContextValue(key, value, depth);
|
||||
|
||||
console.log(getContextStack());
|
||||
browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||
if (message.type === "GET_CONTEXT_STACK") {
|
||||
const contextStack = getContextStack();
|
||||
const contextStack = window.wrappedJSObject.getContextStack();
|
||||
|
||||
sendResponse({ contextStack });
|
||||
} else if (message.type === "UPDATE_CONTEXT_VALUE") {
|
||||
const { key, value, depth } = message;
|
||||
if (glowindow.updateContextValue) {
|
||||
updateContextValue(key, value, depth);
|
||||
if (window.wrappedJSObject.updateContextValue) {
|
||||
window.wrappedJSObject.updateContextValue(key, value, depth);
|
||||
sendResponse({ success: true });
|
||||
} else {
|
||||
sendResponse({
|
||||
@@ -24,4 +16,5 @@ browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||
}
|
||||
}
|
||||
});
|
||||
// }, 0);
|
||||
|
||||
browser.runtime.sendMessage({ type: "PAGE_LOADED" });
|
||||
|
Reference in New Issue
Block a user