fix(browser-extension): minor bugs
This commit is contained in:
parent
2aaae54267
commit
516afb1c25
@ -46,7 +46,7 @@ const enablePopup = (tabId) => chrome.browserAction.setPopup({ popup: 'popup.htm
|
||||
* @description Retrieves cache state
|
||||
* @param {string} hostname
|
||||
* @param {void} callback
|
||||
* @returns {Promise<{ enabled: boolean }>}
|
||||
* @returns {{ enabled: boolean }}
|
||||
*/
|
||||
|
||||
const getCache = (hostname, callback) => {
|
||||
|
@ -30,7 +30,7 @@ const fixes = [];
|
||||
* @description Hostname
|
||||
*/
|
||||
|
||||
const hostname = document.location.hostname;
|
||||
const hostname = document.location.hostname.split('.').slice(-2).join('.');
|
||||
|
||||
/**
|
||||
* @description Is consent preview page?
|
||||
@ -157,7 +157,7 @@ const promiseAll = () =>
|
||||
|
||||
document.addEventListener('readystatechange', () => {
|
||||
dispatch({ hostname, type: 'GET_CACHE' }, null, async ({ enabled }) => {
|
||||
if (document.readyState === 'complete' && enabled && !preview) {
|
||||
if (document.readyState === 'complete' && enabled && !preview && selectors.length) {
|
||||
const nodes = Array.from(document.querySelectorAll(selectors));
|
||||
|
||||
fix();
|
||||
|
Loading…
Reference in New Issue
Block a user