mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +00:00
Update chrome.js
This commit is contained in:
parent
e891f3d1dc
commit
e8e08c5a2d
|
@ -297,12 +297,34 @@ var ChromeObject = function() {
|
|||
});
|
||||
};
|
||||
|
||||
this.getPagesByUrls = function(urls) {
|
||||
return this.getPageList().reduce(function(acc, x) {
|
||||
for (var i = 0; i < urls.length; i++) {
|
||||
if (x.url.indexOf(urls[i]) == 0) {
|
||||
acc.push(x);
|
||||
}
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
};
|
||||
|
||||
this.getPagesByTitle = function(title) {
|
||||
return this.getPageList().filter(function(x) {
|
||||
return (x.title.indexOf(title) == 0);
|
||||
});
|
||||
};
|
||||
|
||||
this.getPagesByTitles = function(titles) {
|
||||
return this.getPageList().reduce(function(acc, x) {
|
||||
for (var i = 0; i < titles.length; i++) {
|
||||
if (x.title.indexOf(titles[i]) == 0) {
|
||||
acc.push(x);
|
||||
}
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
};
|
||||
|
||||
this.sendPageRPC = function(method, params) {
|
||||
var result = null;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user