JS问题 only URL changes and page is refreshed but not totally reloaded.
I have used hash urls for my website and made safari extension for the same. For login/logout my extension opens ourdmain.in in new tab and listens to update methods.
I have implemented chrome.tabs.onUpdated.addListener() to listen to tab updates and for chrome this is working fine but for Safari its not working properly.
I have implemented following method in my background.js:
chrome.tabs.onUpdated.addListener(function (tabID, changeInfo, tab) {
console.log("Updated tab (" + tabID + ")=>>> " + tab.url);
//chrome.tabs.sendMessage(tabID, { name: 'Chrome Tabs updated >>>>>> ' + tab.url });
if (tab.status == 'complete' && tab.url.startsWith(_config.baseURL + '/login?signedout=1')) {
console.log('Clearing extension state!');
}
if (tab.status == 'complete' && tab.url === _config.baseURL + '/dashboard?extension=1') {
console.log("Login process");
}
});
, only URL changes and page is refreshed but not totally reloaded. However, this works perfectly fine with Chrome.

浙公网安备 33010602011771号