Skip to content

Instantly share code, notes, and snippets.

@moyashi
Last active February 9, 2019 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moyashi/ccae1a22d276337070005833e0c38334 to your computer and use it in GitHub Desktop.
Save moyashi/ccae1a22d276337070005833e0c38334 to your computer and use it in GitHub Desktop.
AliExpressで次のページをめくるブックマークレット
javascript:var%20url%3DString(window.location.href)%3Bvar%20match%3Durl.match(%2F%26page%3D(%5Cd%2B)%2F)%3Bif(match%20!%3Dnull)%7Bvar%20page%3Dmatch%5B1%5D%3Bvar%20nextPage%3DString(Number(page)%2B%201)%3BnextUrl%3Durl.replace(match%5B0%5D%2Cmatch%5B0%5D.replace(page%2CnextPage))%3Bwindow.location%3DnextUrl%3B%7Delse%7Bwindow.location%3Durl%20%2B%20%22%26page%3D2%22%3B%7Dvoid(0);
@moyashi
Copy link
Author

moyashi commented Feb 9, 2019

AliExpressでBROMPTONと検索すると強制的にcromptonに訂正されてしまい、ページがめくれないので作ったブックマークレット
https://ja.aliexpress.com/wholesale?g=y&d=y&misspellText=brompton&cpt=1549695137463&origin=yjump=afs&aff_platform=link-c-tool&SearchText=brompton&tc=af&isViewCP=y

var url = String(window.location.href);
var match = url.match(/&page=(\d+)/);
if (match != null) {
var page = match[1];
var nextPage = String(Number(page) + 1);
nextUrl = url.replace(match[0], match[0].replace(page, nextPage));
window.location = nextUrl;
} else {
window.location = url + "&page=2";
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment