-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathpagerize_amazon.user.js
More file actions
28 lines (24 loc) · 1.19 KB
/
Copy pathpagerize_amazon.user.js
File metadata and controls
28 lines (24 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// ==UserScript==
// @name Pagerize Amazon
// @description Mark up Amazon search results with pager metadata
// @author chocolateboy
// @copyright chocolateboy
// @version 0.1.2
// @namespace https://github.com/chocolateboy/userscripts
// @license GPL: https://www.gnu.org/copyleft/gpl.html
// @include http://*.amazon.tld/*
// @include https://*.amazon.tld/*
// @require https://code.jquery.com/jquery-3.5.1.slim.min.js
// @require https://cdn.jsdelivr.net/gh/chocolateboy/jquery-pagerizer@v1.0.0/dist/pagerizer.min.js
// @require https://cdn.jsdelivr.net/gh/eclecto/jQuery-onMutate@79bbb2b8caccabfc9b9ade046fe63f15f593fef6/src/jquery.onmutate.min.js
// @grant GM_log
// ==/UserScript==
// XXX note: the unused grant is a workaround for a Greasemonkey bug:
// https://github.com/greasemonkey/greasemonkey/issues/1614
// union the selectors to work around a jQuery-onMutate bug:
// https://github.com/eclecto/jQuery-onMutate/issues/18
function onLinks ($links) {
$links.filter('a#pagnPrevLink').addRel('prev');
$links.filter('a#pagnNextLink').addRel('next');
}
$.onCreate('a#pagnPrevLink, a#pagnNextLink', onLinks, true /* multi */);