sanitysama

G.E-Hentai Archive Download Links on Exhentai Galleries 1.3

Mar 10th, 2018
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @id             exhentai.org-c5e3fcf9-ef12-4079-a201-d1b750e87520@sanitysama
  3. // @name           G.E-Hentai Archive Download Links on Exhentai Galleries
  4. // @version        1.3
  5. // @description    Adds an g.e-hentai gallery link on exhentai.
  6. // @include        *://exhentai.org/g/*/*/
  7. // @include        *://e-hentai.org/g/*/*/
  8. // @require        http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  9. // @run-at         document-end
  10. // ==/UserScript==
  11.  
  12. function relink(place){
  13.     var a = $(place);
  14.     var c = a.attr("onclick").split("\'");
  15.         a.removeAttr("onclick");
  16.         a.attr("href", c[1]);
  17.     }
  18.  
  19. if(document.URL.indexOf("exhentai.org/g/") >= 0){
  20.     var go = document.getElementsByClassName("g2")[0];
  21.     var pa = document.createElement('p');
  22.         pa.setAttribute('style','padding: 0 0 9px');
  23.         pa.setAttribute('id','goto');
  24.     $(go).after(pa);
  25.     var im = document.createElement('img');
  26.         im.setAttribute('src','https://exhentai.org/img/mr.gif');
  27.         $("#goto").append(im);
  28.         $(im).after(" ");
  29.     var ah = document.URL.substring(10);
  30.     var glink = document.createElement('a');
  31.         glink.setAttribute('href', "http://e-" + ah);
  32.         glink.setAttribute('id', "glink");
  33.         glink.setAttribute('style', "font-weight: bold;text-decoration: none;");
  34.         tn = document.createTextNode('Go to e-hentai.org');
  35.         glink.appendChild(tn);
  36.       $("#goto").append(glink);
  37.     relink('#gd5 > .g3 + .g2 > a');
  38.     relink('#gd5 > .g3 + .g2 + #goto + .g2 > a');
  39.     }
  40.  
  41. if(document.URL.indexOf("e-hentai.org/g/") >= 0){
  42.     relink('#gd5 > .g3 + .g2 > a');
  43.     relink('#gd5 > .g3 + .g2 + .g2 > a');
  44.     }
Add Comment
Please, Sign In to add comment