mirror of
https://gitlab.com/KevinRoebert/ClearUrls
synced 2025-12-16 06:05:37 +07:00
Version 1.6.2
Added: + Added rules from #172 + Added rules from #176 + Added rules from #178 Fixed: + #170 + #162 + #163
This commit is contained in:
@@ -25,16 +25,16 @@
|
||||
|
||||
function historyListenerStart() {
|
||||
if(storage.historyListenerEnabled) {
|
||||
browser.webNavigation.onHistoryStateUpdated.addListener(historyCleaner);
|
||||
browser.webNavigation.onHistoryStateUpdated.addListener(historyCleaner);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that is triggered on history changes. Injects script into page
|
||||
* to clean links that were pushed to the history stack with the
|
||||
* history.pushState method.
|
||||
* history.replaceState method.
|
||||
* @param {state object} details The state object is a JavaScript object
|
||||
* which is associated with the new history entry created by pushState()
|
||||
* which is associated with the new history entry created by replaceState()
|
||||
*/
|
||||
function historyCleaner(details) {
|
||||
var urlBefore = details.url;
|
||||
@@ -43,7 +43,7 @@ function historyCleaner(details) {
|
||||
if(urlBefore != urlAfter) {
|
||||
browser.tabs.executeScript(details.tabId, {
|
||||
frameId: details.frameId,
|
||||
code: 'history.pushState({state: "cleaned_history"},"",'+JSON.stringify(urlAfter)+');'
|
||||
code: 'history.replaceState({state: "cleaned_history"},"",'+JSON.stringify(urlAfter)+');'
|
||||
}).then(() => {}, onError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ function countFields(url)
|
||||
*/
|
||||
function extractFileds(url)
|
||||
{
|
||||
return (url.match(/[^\/|\?|&]+=[^\/|\?|&]+/gi) || []);
|
||||
return (url.match(/[^\/|\?|&]+=*[^\/|\?|&]+/gi) || []);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user