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

This commit is contained in:
vermillion-dev committed 2019-05-30 23:34:14 +02:00
1 parent e61d95e733
commit c87c36f4b3
4 files changed
+72 -9

No files matched your search

+12 -1
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;
}
}
});