Created
August 6, 2019 11:46
-
-
Save QGB/df7662ab97cc2ee5fe4e8b271daefbb6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
soutput = U._TEXT(function() {/* | |
gs_qgb_base_url="http://192.168.1.111:23571/r=F.read(T.subLast(request.url,'%23'))%23e:/QGB/babun/cygwin/home/qgb/js/" | |
function sleep(ms) {return new Promise(resolve => setTimeout(resolve, ms) ) } | |
loadQGB=function (isPrint){ | |
xhr=new XMLHttpRequest() | |
xhr.open('get',gs_qgb_base_url+'qgb.js') | |
xhr.onload=function(){ | |
eval(this.response) | |
if(isPrint===undefined) console.log('loaded length '+this.response.length) | |
} | |
xhr.send() | |
return xhr | |
} | |
loadQGB() | |
iframe=document.querySelector('iframe[id=mframe]') | |
if(iframe && iframe.contentDocument) | |
doc=iframe.contentDocument | |
else | |
doc=document | |
console.log(doc) | |
async function main(){ | |
//await sleep(11) | |
var c=doc.querySelector('div.contenttext') | |
if(!c){return main()} | |
var r=[doc.location.href,c.outerText] //,c.outerHTML] | |
await N.postJSON("http://in.com:23571/import%20main;j=request.get_data();j=T.json_loads(j)%0aif(j):r=main.update_content(*j)%0aelse:r=response.status_code=500",r) | |
} | |
main() | |
*/ | |
}) | |
//////////////////////////////////////////////////////////////////////////////////// | |
gib = 1 | |
async function background_main() { | |
while (gib) { | |
gib += 1 | |
tabs=await new Promise(resolve => { | |
chrome.tabs.query({url: 'http://0731.mfyq.com.cn/index.action?toAction=goArticleDetailView.action?checkedIds=*'}, response => resolve(response)); | |
}); | |
if(!gib)console.log(tabs) | |
tab=tabs[0] | |
myNewUrl=await N.get("http://in.com:23571/import%20main;r=main.pop_sina_detail_url()") | |
// myNewUrl="http://0731.mfyq.com.cn/index.action?toAction=goArticleDetailView.action?checkedIds=1321999,{},,1,1,1,,,-1,0,1".replace('{}',id) | |
chrome.tabs.update(tab.id, {url: myNewUrl}); | |
await U.sleep(2999) | |
chrome.tabs.executeScript(tab.id, { | |
code: soutput | |
}) | |
await U.sleep(1955) | |
} | |
console.log('#### done',gib) | |
} | |
background_main() | |
// async function test(){ | |
// chrome.tabs.query({ | |
// url: 'http://0731.mfyq.com.cn/index.action?toAction=goArticleDetailView.action?checkedIds=1321999*' | |
// }, function(tabs) { | |
// tab = tabs[0] | |
// console.log(tab) | |
// chrome.tabs.executeScript(tab.id, { | |
// code: sinput | |
// }) | |
// }) | |
// } | |
// test() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment