From ebf06a66c54b334da89e36e43a42dbba2c02fc0b Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 25 Oct 2017 22:46:02 -0400 Subject: [PATCH] scope collection from notification bar to a frame --- src/background.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/background.js b/src/background.js index 2c8808cde8..3625591cf9 100644 --- a/src/background.js +++ b/src/background.js @@ -104,7 +104,7 @@ var bg_isBackground = true, messageTab(sender.tab.id, 'adjustNotificationBar', msg.data); } else if (msg.command === 'bgCollectPageDetails') { - collectPageDetailsForContentScript(sender.tab, msg.sender); + collectPageDetailsForContentScript(sender.tab, msg.sender, sender.frameId); } else if (msg.command === 'bgAddLogin') { addLogin(msg.login, sender.tab); @@ -568,16 +568,21 @@ var bg_isBackground = true, }); } - function collectPageDetailsForContentScript(tab, sender) { + function collectPageDetailsForContentScript(tab, sender, frameId) { if (!tab || !tab.id) { return; } + var options = {}; + if (frameId || frameId === 0) { + options.frameId = frameId; + } + chrome.tabs.sendMessage(tab.id, { command: 'collectPageDetails', tab: tab, sender: sender - }, function () { + }, options, function () { if (chrome.runtime.lastError) { return; }