From 0b34b991bfa99416f7797fa0e91aa49a59ca4c00 Mon Sep 17 00:00:00 2001 From: luke crouch Date: Thu, 21 Jul 2016 11:26:31 -0500 Subject: [PATCH] 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. --- inpage-toolbar-ui/contentscript.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/inpage-toolbar-ui/contentscript.js b/inpage-toolbar-ui/contentscript.js index e99e84e..ab822e5 100644 --- a/inpage-toolbar-ui/contentscript.js +++ b/inpage-toolbar-ui/contentscript.js @@ -22,15 +22,13 @@ function toggleToolbar(toolbarUI) { } } -// Handle messages from the add-on background page (only in top level iframes) -if (window.parent == window) { - chrome.runtime.onMessage.addListener(function(msg) { - if (msg == "toggle-in-page-toolbar") { - if (toolbarUI) { - toggleToolbar(toolbarUI); - } else { - toolbarUI = initToolbar(); - } +// Handle messages from the add-on background page +chrome.runtime.onMessage.addListener(function(msg) { + if (msg == "toggle-in-page-toolbar") { + if (toolbarUI) { + toggleToolbar(toolbarUI); + } else { + toolbarUI = initToolbar(); } - }); -} + } +});