mirror of
https://github.com/NohamR/BetterYGG.git
synced 2026-01-10 08:18:19 +00:00
[1.2] Fix the order by number of comment
This commit is contained in:
8
contentScripts/search/accessSearch.js
Normal file
8
contentScripts/search/accessSearch.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
var commentaryWrongLink = $('a:contains(Comm.)')[0];
|
||||||
|
var hrefArray = commentaryWrongLink.href.split('&');
|
||||||
|
var searchArray = document.location.search.split('&');
|
||||||
|
if (searchArray.includes('order=desc') && searchArray.includes('sort=comment')) {
|
||||||
|
hrefArray[hrefArray.length - 2] = 'order=asc';
|
||||||
|
}
|
||||||
|
hrefArray[hrefArray.length - 1] = 'sort=comment';
|
||||||
|
commentaryWrongLink.href = hrefArray.join('&');
|
||||||
@@ -1,10 +1,5 @@
|
|||||||
var path = window.location.toString();
|
/* Inject scripts don't forget to add them to web_accessible_resources in manifest */
|
||||||
var args = path.split('&');
|
injectScript(chrome.extension.getURL('contentScripts/search/accessSearch.js'), 'head');
|
||||||
if (args[args.length -1] === 'do=search') {
|
|
||||||
window.location.replace(path + '&order=desc&sort=publish_date');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
var table = document.getElementsByTagName('tbody')[1];
|
|
||||||
|
|
||||||
function addDlButton(idx, torrentId, yggToken) {
|
function addDlButton(idx, torrentId, yggToken) {
|
||||||
var cell = table.rows[idx].cells[2];
|
var cell = table.rows[idx].cells[2];
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
"web_accessible_resources" : [
|
"web_accessible_resources" : [
|
||||||
"contentScripts/addTorrent/accessAddTorrent.js",
|
"contentScripts/addTorrent/accessAddTorrent.js",
|
||||||
"contentScripts/allPages/accessAllPages.js",
|
"contentScripts/allPages/accessAllPages.js",
|
||||||
|
"contentScripts/search/accessSearch.js",
|
||||||
"css/style.css",
|
"css/style.css",
|
||||||
"img/download.png"
|
"img/download.png"
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user