Update chrome.js

This commit is contained in:
Namhyeon Go 2025-06-18 14:56:20 +09:00
parent 526eb92e61
commit 9b6270ff72

View File

@ -56,6 +56,7 @@ var ChromeObject = function() {
this.pageList = [];
this.title = "";
this.frameIndex = -1;
this.disableFeatures = ["ShowBookmarksBar", "Translate"];
this.isPreventEvaluate = false;
this.isAppMode = false;
@ -319,6 +320,9 @@ var ChromeObject = function() {
cmd.push("\"--user-agent=" + this.userAgent + "\"");
}
// disable an unwanted features
cmd.push("--disable-features=" + this.disableFeatures.join(','));
// set the URL
cmd.push((this.isAppMode ? "--app=\"" : "\"") + url + "\"");
@ -1383,6 +1387,31 @@ var ChromeObject = function() {
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();
};
ChromeObject.prototype = new STD.EventTarget();
@ -1453,7 +1482,7 @@ exports.startDebugInPrivate = function(url, proxy, profileName, debuggingPort, i
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.global = global;
exports.require = global.require;