mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
cache bg page and more debug logs for edge 18
This commit is contained in:
@@ -17,7 +17,7 @@ function bootstrapModule() {
|
||||
}
|
||||
|
||||
// Bug in Edge 18 has null getBackgroundPage() result initially. Can be removed in future.
|
||||
if (BrowserApi.getBackgroundPage() == null && window.navigator.userAgent.indexOf(' Edge/18.') !== -1) {
|
||||
if (BrowserApi.getBackgroundPage() == null && BrowserApi.isEdge18) {
|
||||
const sleep = (time: number) => new Promise((resolve) => window.setTimeout(resolve, time));
|
||||
const bootstrapForEdge18 = async () => {
|
||||
let bgAttempts = 1;
|
||||
@@ -40,5 +40,9 @@ if (BrowserApi.getBackgroundPage() == null && window.navigator.userAgent.indexOf
|
||||
};
|
||||
bootstrapForEdge18();
|
||||
} else {
|
||||
if (BrowserApi.isEdge18) {
|
||||
// tslint:disable-next-line
|
||||
console.log('Normal bootstrap.');
|
||||
}
|
||||
bootstrapModule();
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@ export class LaunchGuardService implements CanActivate {
|
||||
|
||||
async canActivate() {
|
||||
if (BrowserApi.getBackgroundPage() == null) {
|
||||
if (BrowserApi.isEdge18) {
|
||||
// tslint:disable-next-line
|
||||
console.log('getBackgroundPage is null from launch guard.');
|
||||
}
|
||||
this.router.navigate(['private-mode']);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user