mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-17 23:08:33 +02:00
remove window.parent check from contentscript
The manifest 'all_frames' property defaults to false, so the contentscript should not need to perform the window.parent check.
This commit is contained in:
@@ -22,15 +22,13 @@ function toggleToolbar(toolbarUI) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle messages from the add-on background page (only in top level iframes)
|
// Handle messages from the add-on background page
|
||||||
if (window.parent == window) {
|
chrome.runtime.onMessage.addListener(function(msg) {
|
||||||
chrome.runtime.onMessage.addListener(function(msg) {
|
if (msg == "toggle-in-page-toolbar") {
|
||||||
if (msg == "toggle-in-page-toolbar") {
|
if (toolbarUI) {
|
||||||
if (toolbarUI) {
|
toggleToolbar(toolbarUI);
|
||||||
toggleToolbar(toolbarUI);
|
} else {
|
||||||
} else {
|
toolbarUI = initToolbar();
|
||||||
toolbarUI = initToolbar();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user