Skip to content

Commit

Permalink
function renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
keys-defender authored Mar 19, 2021
1 parent 158298a commit f5a0510
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/universal-bridge-against-phishing.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
setInterval(conditionallyUpdatePhishList, CONSTS.PERIODIC_UPDATE_BLACKLIST);

// Some JS breaks on hive.blog doing a history override. Using this to detect when to use a fallback.
const supportsHistoryOverride = () => {
const supportsAllOverrides = () => {
// ReactJs
if (!!window.React || !!document.querySelector('[data-reactroot], [data-reactid]'))
return false;
Expand All @@ -78,7 +78,7 @@
};

// Fetch updated domains list on page view change (if not recently fetched)
if (supportsHistoryOverride()) {
if (supportsAllOverrides()) {
const pushState = history.pushState;
history.pushState = (...args) => { // <<< global override
log.debug('History change (ps), checking age of blacklist');
Expand Down Expand Up @@ -208,7 +208,7 @@
const originalGetAttribute = element.getAttribute.bind(element);
// Override element "src" or "href" attribute getter and setter
// Note: hive.blog uses definePropety too, cannot use
if (supportsHistoryOverride()) {
if (supportsAllOverrides()) {
Object.defineProperties(element, {
[attributeToMutate]: {
get: () => {
Expand Down

0 comments on commit f5a0510

Please sign in to comment.