Skip to content

Commit

Permalink
remove unnecessary helper & improve guard comment
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislav-atr committed Oct 25, 2022
1 parent 4fe3dc5 commit da7919e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/scriptlets/trusted-set-cookie.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
hit,
nativeIsNaN,
prepareCookie,
isCookieSetWithValue,
} from '../helpers/index';

Expand Down Expand Up @@ -62,7 +61,8 @@ export function trustedSetCookie(source, name, value, offsetExpiresSec = '', rel
return;
}

// Prevent infinite reloads if cookie was already set
// Prevent infinite reloads if cookie was already set or blocked by the browser
// https://github.com/AdguardTeam/Scriptlets/issues/212
if (reload === 'true' && isCookieSetWithValue(document.cookie, name, value)) {
return;
}
Expand Down Expand Up @@ -141,6 +141,5 @@ trustedSetCookie.names = [
trustedSetCookie.injections = [
hit,
nativeIsNaN,
prepareCookie,
isCookieSetWithValue,
];

0 comments on commit da7919e

Please sign in to comment.