Update chrome.js

This commit is contained in:
Namhyeon Go 2025-06-01 21:39:13 +09:00
parent 821b3748df
commit 19d4cdce6c

View File

@ -297,11 +297,11 @@ var ChromeObject = function() {
// set user agent // set user agent
if (this.userAgent != null) { if (this.userAgent != null) {
cmd.push("--user-agent=\"" + this.userAgent + "\""); cmd.push("\"--user-agent=" + this.userAgent + "\"");
} }
// set the URL // set the URL
cmd.push((!this.isAppMode ? "\"" : "--app=\"") + url + "\""); cmd.push((this.isAppMode ? "--app=\"" : "\"") + url + "\"");
// build the command line // build the command line
console.log(cmd.join(" ")); console.log(cmd.join(" "));
@ -313,7 +313,7 @@ var ChromeObject = function() {
// release shell // release shell
shell.release(); shell.release();
} catch (e) { } catch (e) {
console.error(e.message, ", Error in ChromeObject.open()"); console.error("Error opening a browser: " + e.message);
sleep(300); sleep(300);
} }
@ -326,7 +326,7 @@ var ChromeObject = function() {
if (this.debuggingPort > 0) { if (this.debuggingPort > 0) {
try { try {
var responseText = HTTP.get("http://127.0.0.1:" + this.debuggingPort + "/json"); var responseText = HTTP.get("http://127.0.0.1:" + this.debuggingPort + "/json");
var pageList = JSON.parse(responseText); pageList = JSON.parse(responseText);
this.pageList = pageList; // save the page list this.pageList = pageList; // save the page list
} catch (e) { } catch (e) {
@ -1245,11 +1245,11 @@ var ChromeObject = function() {
// @deprecated // @deprecated
this.setVendor = function(vendor) { this.setVendor = function(vendor) {
this.setPublisherName(vendor); this.setPublisherName(vendor);
console.warn("Deprecated: setVendor, Alternative: setPublisherName"); console.warn("Deprecated: Please use setPublisherName");
}; };
this.setPublisherName = function(publisherName) { this.setPublisherName = function(publisherName) {
var publisherName = publisherName.toLowerCase(); publisherName = publisherName.toLowerCase();
switch (publisherName) { switch (publisherName) {
case "msedge": case "msedge":