Automatically inserts the next page.
[
{
url: string(regexp),
nextLink: string(xpath),
pageElement: string(xpath),
insertBefore: string(xpath) | null
},
// sample
{
url: '^https://blog\\.mozilla\\.org/futurereleases/(page/\\d+/)?$',
nextLink: '//li[@class="prev"]//a',
pageElement: '//article',
insertBefore: '//nav[@class="nav-paging"]',
exampleUrl: 'https://blog.mozilla.org/futurereleases/',
},
]
<hr class="autopagerize_page_separator">
<p class="autopagerize_page_info">
page: <a class="autopagerize_link" href="http://www.example.com/?page=2">2</a>
</p>
document.addEventListener("AutoPagerize_DOMNodeInserted", function(event) {
console.log("pageElement: ", event.target);
console.log("parentNode: ", event.relatedNode);
console.log("url: ", event.newValue);
}, false);
document.dispatchEvent(new Event("AutoPagerizeToggleRequest"));
document.dispatchEvent(new CustomEvent("AutoPagerize_launchAutoPager", {detail: {
siteinfo: [
{
url: '^https://blog\\.mozilla\\.org/futurereleases/(page/\\d+/)?$',
nextLink: '//li[@class="prev"]//a',
pageElement: '//article',
insertBefore: '//nav[@class="nav-paging"]',
},
],
}}));
See src/userscript/naver-matome.js.
Name | weAutoPagerize | AutoPagerize (userscript) | AutoPagerize | uAutoPagerize |
---|---|---|---|---|
HTML Classes | ✔ | ✔ | ✔ | ✔ |
SITEINFO | ✔ | ✔ | ✔ | ✔ |
SITEINFO options.useUserFetch | ✔ | |||
SITEINFO options.useResponseFilter | ✔ | |||
GM_AutoPagerizeLoaded | ✔ | ✔ | ✔ | ✔ |
GM_AutoPagerizeNextPageLoaded | ✔ | ✔ | ✔ | ✔ |
AutoPagerize_DOMNodeInserted | ✔ | ✔ | ✔ | ✔ |
AutoPagerizeToggleRequest | ✔ | ✔ | ✔ | ✔ |
AutoPagerizeEnableRequest | ✔ | ✔ | ✔ | |
AutoPagerizeDisableRequest | ✔ | ✔ | ✔ | |
AutoPagerize_launchAutoPager | ✔ | ✔ | ||
AutoPagerizeResponseFilterRequest | ✔ | |||
AutoPagerizeResponseFilterResponse | ✔ | |||
AutoPagerizeUserFetchRequest | ✔ | |||
AutoPagerizeUserFetchResponse | ✔ | |||
AutoPagerizeUpdateIconRequest | ✔ | |||
AutoPagerizeUpdateSettingsRequest | ✔ | |||
uAutoPagerize_Launched | ||||
uAutoPagerize_StateChange | ✔ | |||
uAutoPagerize_Destroy | ✔ | |||
uAutoPagerize_RequestLoad | ✔ | |||
uAutoPagerize_RequestError | ✔ | |||
uAutoPagerize_Request | ✔ | |||
uAutoPagerize_Restart | ✔ |
- AutoPagerize (userscript) 0.0.66
- AutoPagerize 0.3.9
- uAutoPagerize 0.1.4.1
git clone https://github.com/wantora/weautopagerize.git
cd weautopagerize
npm install
npm run build