Advertisement
Yunga

Amazon URL Cleaner Bookmarklet

Jan 22nd, 2020
693
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Clean amazon url, only keeping dp/id
  2.  
  3. javascript:(function(){
  4.  
  5.     if ( capture = /:\/\/(?:\w+)?\.?(amazon\.\w+)\/.*?(\/dp\/\w+)\W/.exec( document.URL ) ) {
  6.  
  7.         let newURL = "http://" + capture[1] + capture[2];
  8.         console.log( 'Amazon Bookmarklet - Suggested URL: ' + newURL );
  9.         window.location.href = newURL;
  10.  
  11.     }
  12.  
  13. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement