mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-11-28 18:41:04 +00:00
Update chrome.js
This commit is contained in:
parent
526eb92e61
commit
9b6270ff72
|
|
@ -56,6 +56,7 @@ var ChromeObject = function() {
|
||||||
this.pageList = [];
|
this.pageList = [];
|
||||||
this.title = "";
|
this.title = "";
|
||||||
this.frameIndex = -1;
|
this.frameIndex = -1;
|
||||||
|
this.disableFeatures = ["ShowBookmarksBar", "Translate"];
|
||||||
|
|
||||||
this.isPreventEvaluate = false;
|
this.isPreventEvaluate = false;
|
||||||
this.isAppMode = false;
|
this.isAppMode = false;
|
||||||
|
|
@ -319,6 +320,9 @@ var ChromeObject = function() {
|
||||||
cmd.push("\"--user-agent=" + this.userAgent + "\"");
|
cmd.push("\"--user-agent=" + this.userAgent + "\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable an unwanted features
|
||||||
|
cmd.push("--disable-features=" + this.disableFeatures.join(','));
|
||||||
|
|
||||||
// set the URL
|
// set the URL
|
||||||
cmd.push((this.isAppMode ? "--app=\"" : "\"") + url + "\"");
|
cmd.push((this.isAppMode ? "--app=\"" : "\"") + url + "\"");
|
||||||
|
|
||||||
|
|
@ -1383,6 +1387,31 @@ var ChromeObject = function() {
|
||||||
this.evaluate('document.documentElement.requestFullscreen();');
|
this.evaluate('document.documentElement.requestFullscreen();');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.getDisableFeatureIndex = function(feature) {
|
||||||
|
return this.disableFeatures.indexOf(feature);
|
||||||
|
};
|
||||||
|
|
||||||
|
this.isFeatureDisabled = function(feature) {
|
||||||
|
return this.getDisableFeatureIndex(feature) > -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.addDisableFeature = function(feature) {
|
||||||
|
if (!this.isFeatureDisabled(feature)) {
|
||||||
|
this.disableFeatures.push(feature);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.removeDisableFeature = function(feature) {
|
||||||
|
var index = this.getDisableFeatureIndex(feature);
|
||||||
|
if (index > -1) {
|
||||||
|
this.disableFeatures.splice(index, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
this.create();
|
this.create();
|
||||||
};
|
};
|
||||||
ChromeObject.prototype = new STD.EventTarget();
|
ChromeObject.prototype = new STD.EventTarget();
|
||||||
|
|
@ -1453,7 +1482,7 @@ exports.startDebugInPrivate = function(url, proxy, profileName, debuggingPort, i
|
||||||
|
|
||||||
exports.publisherName = publisherName;
|
exports.publisherName = publisherName;
|
||||||
|
|
||||||
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.4.22";
|
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.4.23";
|
||||||
exports.AUTHOR = "abuse@catswords.net";
|
exports.AUTHOR = "abuse@catswords.net";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user