[1.2] Set the order and the sort on search default

This commit is contained in:
vermillion-dev
2019-05-30 19:13:54 +02:00
parent e61d95e733
commit c87c36f4b3
4 changed files with 72 additions and 9 deletions

View File

@@ -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;
}
}
});