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:
luke crouch
2016-07-21 11:26:31 -05:00
committed by GitHub
parent ec1830914e
commit 0b34b991bf

View File

@@ -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();
}
} }
}); }
} });