Skip to content

Commit

Permalink
try to address #47
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe12387 committed Feb 9, 2025
1 parent 5ab5e4c commit 164580f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions dist/detectIncognito.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions dist/detectIncognito.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ function detectIncognito() {
}
function feid() {
var toFixedEngineID = 0;
var neg = parseInt("-1");
try {
eval("(-1).toFixed(-1);");
neg.toFixed(neg);
}
catch (e) {
toFixedEngineID = e.message.length; // Safari 44, Chrome 51, Firefox 25
toFixedEngineID = e.message.length;
}
return toFixedEngineID;
}
Expand Down
4 changes: 2 additions & 2 deletions dist/es5/detectIncognito.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/detectIncognito.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ export async function detectIncognito(): Promise<{ isPrivate: boolean; browserNa

function feid (): number {
let toFixedEngineID = 0
let neg = parseInt("-1")
try {
eval(`(-1).toFixed(-1);`);
neg.toFixed(neg)
} catch (e) {
toFixedEngineID = (e as Error).message.length // Safari 44, Chrome 51, Firefox 25
toFixedEngineID = (e as Error).message.length
}
return toFixedEngineID
}

function isSafari (): boolean {
return feid() === 44
}
Expand Down

0 comments on commit 164580f

Please sign in to comment.