1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-10-01 04:27:40 +02:00

scope collection from notification bar to a frame

This commit is contained in:
Kyle Spearrin 2017-10-25 22:46:02 -04:00
parent 1c3143867b
commit ebf06a66c5

View File

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