Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This snippet automatically converts any e621.net sample and preview image links into their full resolution when opened.
- // Use Chrome plugin "Custom JavaScript for Websites 2"
- // Include jQuery 3.2.1 in definition
- function searchRedirect() {
- var loc = window.location.pathname;
- var md5 = false;
- if (loc.startsWith('/data/sample/')) {
- md5 = loc.substring(19, 19+32);
- } else if (loc.startsWith('/data/preview/')) {
- md5 = loc.substring(20, 20+32);
- }
- if (md5) {
- $.ajax({url: 'https://e621.net/post/show.json?md5=' + md5,
- dataType: 'jsonp',
- crossDomain: true,
- success: function(data) {
- window.location.replace(data.file_url);
- }});
- }
- }
- searchRedirect();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement