Skip to content

Commit

Permalink
Update to self
Browse files Browse the repository at this point in the history
  • Loading branch information
justindbaur committed Sep 28, 2022
1 parent a384a69 commit 8f1eb2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions apps/browser/src/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export {};

declare function escape(s: string): string;
declare function unescape(s: string): string;
/**
Expand Down Expand Up @@ -127,3 +129,10 @@ declare namespace chrome {
declare let opr: Opera | undefined;
declare let opera: unknown | undefined;
declare let safari: any;

declare global {
interface Window {
opr: Opera | undefined;
opera: unknown;
}
}
6 changes: 3 additions & 3 deletions apps/browser/src/services/browserPlatformUtils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
) {
this.deviceCache = DeviceType.FirefoxExtension;
} else if (
(typeof opr !== "undefined" && typeof opr.addons !== "undefined") ||
typeof opera !== "undefined" ||
(self.opr && self.opr.addons) ||
self.opera ||
navigator.userAgent.indexOf(" OPR/") >= 0
) {
this.deviceCache = DeviceType.OperaExtension;
} else if (navigator.userAgent.indexOf(" Edg/") !== -1) {
this.deviceCache = DeviceType.EdgeExtension;
} else if (navigator.userAgent.indexOf(" Vivaldi/") !== -1) {
this.deviceCache = DeviceType.VivaldiExtension;
} else if ((window as any).chrome && navigator.userAgent.indexOf(" Chrome/") !== -1) {
} else if (window.chrome && navigator.userAgent.indexOf(" Chrome/") !== -1) {
this.deviceCache = DeviceType.ChromeExtension;
} else if (navigator.userAgent.indexOf(" Safari/") !== -1) {
this.deviceCache = DeviceType.SafariExtension;
Expand Down

0 comments on commit 8f1eb2e

Please sign in to comment.