mirror of
https://github.com/bitwarden/browser.git
synced 2024-09-10 01:28:36 +02:00
detect safari browser properly
This commit is contained in:
parent
17b1d84519
commit
4fe710f8e7
2
jslib
2
jslib
@ -1 +1 @@
|
|||||||
Subproject commit 4614b4a1859999326df6ab6f746babbca343d19d
|
Subproject commit 9de9c1655c9a325443fdabfc74630f06e20f8d9a
|
@ -1,8 +1,9 @@
|
|||||||
document.addEventListener('DOMContentLoaded', (event) => {
|
document.addEventListener('DOMContentLoaded', (event) => {
|
||||||
let pageHref = null;
|
let pageHref = null;
|
||||||
|
const isSafari = (typeof safari !== 'undefined') && navigator.userAgent.indexOf(' Safari/') !== -1 &&
|
||||||
|
navigator.userAgent.indexOf('Chrome') === -1;
|
||||||
|
|
||||||
if ((typeof safari !== 'undefined') && navigator.userAgent.indexOf(' Safari/') !== -1 &&
|
if (isSafari) {
|
||||||
navigator.userAgent.indexOf('Chrome') === -1) {
|
|
||||||
const responseCommand = 'autofillerAutofillOnPageLoadEnabledResponse';
|
const responseCommand = 'autofillerAutofillOnPageLoadEnabledResponse';
|
||||||
safari.self.tab.dispatchMessage('bitwarden', {
|
safari.self.tab.dispatchMessage('bitwarden', {
|
||||||
command: 'bgGetDataForTab',
|
command: 'bgGetDataForTab',
|
||||||
@ -32,7 +33,7 @@ document.addEventListener('DOMContentLoaded', (event) => {
|
|||||||
sender: 'autofiller'
|
sender: 'autofiller'
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((typeof safari !== 'undefined')) {
|
if (isSafari) {
|
||||||
safari.self.tab.dispatchMessage('bitwarden', msg);
|
safari.self.tab.dispatchMessage('bitwarden', msg);
|
||||||
} else {
|
} else {
|
||||||
chrome.runtime.sendMessage(msg);
|
chrome.runtime.sendMessage(msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user