mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 14:53:33 +00:00
scope collection from notification bar to a frame
This commit is contained in:
@@ -104,7 +104,7 @@ var bg_isBackground = true,
|
|||||||
messageTab(sender.tab.id, 'adjustNotificationBar', msg.data);
|
messageTab(sender.tab.id, 'adjustNotificationBar', msg.data);
|
||||||
}
|
}
|
||||||
else if (msg.command === 'bgCollectPageDetails') {
|
else if (msg.command === 'bgCollectPageDetails') {
|
||||||
collectPageDetailsForContentScript(sender.tab, msg.sender);
|
collectPageDetailsForContentScript(sender.tab, msg.sender, sender.frameId);
|
||||||
}
|
}
|
||||||
else if (msg.command === 'bgAddLogin') {
|
else if (msg.command === 'bgAddLogin') {
|
||||||
addLogin(msg.login, sender.tab);
|
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) {
|
if (!tab || !tab.id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var options = {};
|
||||||
|
if (frameId || frameId === 0) {
|
||||||
|
options.frameId = frameId;
|
||||||
|
}
|
||||||
|
|
||||||
chrome.tabs.sendMessage(tab.id, {
|
chrome.tabs.sendMessage(tab.id, {
|
||||||
command: 'collectPageDetails',
|
command: 'collectPageDetails',
|
||||||
tab: tab,
|
tab: tab,
|
||||||
sender: sender
|
sender: sender
|
||||||
}, function () {
|
}, options, function () {
|
||||||
if (chrome.runtime.lastError) {
|
if (chrome.runtime.lastError) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user