-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclose.js
31 lines (31 loc) · 785 Bytes
/
close.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
onload = function () {
var textArea = document.getElementById("weiboPublisher");
var str = textArea.innerHTML;
var finds = "百度文库";
if (str.indexOf(finds) >= 0) {
var queryinfo =
{
"active": true
}
var sendObj =
{
"cmd": "close page",
}
chrome.runtime.sendMessage(sendObj, function (response) { console.log("close rec!"); })
}
else
console.log(textArea.innerHTML);
}
var textArea = document.getElementById("weiboPublisher");
var str=textArea.innerHTML;
var finds="百度文库";
if(str.indexOf(finds)>=0)
{
var sendObj=
{
cmd:"close"
}
chrome.runtime.sendMessage(sendObj);
}
else
console.log(textArea.innerHTML);