SHARE
TWEET

AppleDiary-Viewer

a guest Apr 18th, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name     AppleDiary-Viewer
  3. // @version  1
  4. // @run-at   document-body
  5. // @include  https://tw.appledaily.com/*
  6. // @include  https://tw.*.appledaily.com/*
  7. // @require  https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js
  8. // ==/UserScript==
  9.  
  10. window.addEventListener('beforescriptexecute', function(e) {
  11.  
  12.     var src = e.target.src;
  13.     if (src.search('paywall') != -1) {
  14.         e.preventDefault();
  15.         e.stopPropagation();
  16.     } else if(src.search("omo_member") != -1){
  17.         e.preventDefault();
  18.         e.stopPropagation();
  19.     }
  20.  
  21. }, true);
  22.  
  23. function inject(src) {
  24.  
  25.     var el= document.createElement('script');
  26.     el.type = 'text/javascript';
  27.     el.class = 'injected';
  28.     el.appendChild(document.createTextNode(src));
  29.     var head = document.head || document.getElementsByTagName('head')[0];
  30.     head.insertBefore(el, head.lastChild);
  31. }
  32.  
  33. function paywall(){}
  34. function confirmOMOmember(){return true;}
  35. function OMOSDK(){}
  36. inject(paywall)
  37. inject(confirmOMOmember)
  38. inject(OMOSDK)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top