Skip to content

Instantly share code, notes, and snippets.

@knowlet
Last active July 5, 2019 15:45
Show Gist options
  • Save knowlet/3effa54e5c63031497fafd57b63b74e6 to your computer and use it in GitHub Desktop.
Save knowlet/3effa54e5c63031497fafd57b63b74e6 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name AD News
// @namespace https://knowlet.me
// @version 0.1
// @description try to eat some apple!
// @author knowlet
// @match https://*.appledaily.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
// Your code here...
// OMOSDK.auth().getUserInfo().isLoggedIn
document.documentElement.addEventListener('load', function _find_script(e) {
try {
if (~e.target.src.indexOf("/pay/js/omo_member")){
window.OMOSDK = {
auth: function() {
return {
getUserInfo: function() {
return {
isLoggedIn: false
}
}
}
}
}
window.onload = () => {
fetch('#').then(res => res.text()).then(html => {
var el = document.createElement( 'html' );
el.innerHTML = html
$('main.ndArticle').html($('main.ndArticle').innerHTML);
$('.mediabox,.ndArticle_margin').css({ 'visibility': 'visible' });
});
}
console.log`Let's eat some apple!`;
document.documentElement.removeEventListener("load", _find_script, true);
}
}
catch(err) {}
}, true);
// console.log(`test: ${window.OMOSDK.auth().getUserInfo().isLoggedIn}`);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment