mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-20 16:07:45 +01:00
collect for notification bar inside iframes
This commit is contained in:
parent
e5140595e6
commit
f852cbbfe3
@ -4,7 +4,8 @@
|
||||
barType = null,
|
||||
pageHref = null,
|
||||
observer = null,
|
||||
domObservationCollectTimeout = null;
|
||||
domObservationCollectTimeout = null,
|
||||
iframed = isIframed();
|
||||
|
||||
if (window.location.hostname.indexOf('bitwarden.com') === -1) {
|
||||
chrome.storage.local.get('neverDomains', function (obj) {
|
||||
@ -23,16 +24,25 @@
|
||||
|
||||
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
|
||||
if (msg.command === 'openNotificationBar') {
|
||||
if (iframed) {
|
||||
return;
|
||||
}
|
||||
closeExistingAndOpenBar(msg.data.type, msg.data.typeData);
|
||||
sendResponse();
|
||||
return true;
|
||||
}
|
||||
else if (msg.command === 'closeNotificationBar') {
|
||||
if (iframed) {
|
||||
return;
|
||||
}
|
||||
closeBar(true);
|
||||
sendResponse();
|
||||
return true;
|
||||
}
|
||||
else if (msg.command === 'adjustNotificationBar') {
|
||||
if (iframed) {
|
||||
return;
|
||||
}
|
||||
adjustBar(msg.data);
|
||||
sendResponse();
|
||||
return true;
|
||||
@ -45,6 +55,15 @@
|
||||
}
|
||||
});
|
||||
|
||||
function isIframed() {
|
||||
try {
|
||||
return window.self !== window.top;
|
||||
}
|
||||
catch (e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function observeDom() {
|
||||
var bodies = document.querySelectorAll('body');
|
||||
if (bodies.length > 0) {
|
||||
|
@ -40,7 +40,7 @@
|
||||
"run_at": "document_start"
|
||||
},
|
||||
{
|
||||
"all_frames": false,
|
||||
"all_frames": true,
|
||||
"js": [
|
||||
"content/notificationBar.js"
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user