mirror of
https://github.com/NohamR/BetterYGG.git
synced 2026-01-10 08:18:19 +00:00
[1.2] Set the order and the sort on search default
This commit is contained in:
@@ -4,4 +4,15 @@ injectScript(chrome.extension.getURL('/contentScripts/allPages/accessAllPages.js
|
||||
/* disable annoying fuckn popup */
|
||||
popup = document.querySelector('div.ad-alert-wrapper');
|
||||
if(popup && popup.style.display !== "none")
|
||||
document.querySelector('button.ad-alert-message-continue-btn').click()
|
||||
document.querySelector('button.ad-alert-message-continue-btn').click()
|
||||
|
||||
/* Retrieve credentials from Google Storage*/
|
||||
chrome.storage.sync.get(['searchOrder', 'searchSort'], function(value){
|
||||
/* Update links to order and filter them with our values */
|
||||
if(value.searchOrder && value.searchSort){
|
||||
var elements = document.querySelectorAll('a[href$="do=search"]');
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
elements[i].href += '&order=' + value.searchOrder +'&sort=' + value.searchSort;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user