mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-14 05:31:03 +00:00
Update chrome.js, xml.js
This commit is contained in:
parent
2ca43a791e
commit
2f84b4a732
|
@ -3,11 +3,33 @@
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
var SHELL = require("lib/shell");
|
var SHELL = require("lib/shell");
|
||||||
|
|
||||||
var ChromeBrowser = function() {};
|
var binPath = "%PROGRAMFILES%\\Google\\Chrome\\Application\\chrome.exe";
|
||||||
|
|
||||||
ChromeBrowser.prototype.open = function(profile) {
|
var Chrome = function() {
|
||||||
|
this.profileName = "Default";
|
||||||
|
this.proxyPort = 1080;
|
||||||
|
|
||||||
|
this.setProfileName = function(s) {
|
||||||
|
this.profileName = s;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.open = ChromeBrowser.open;
|
this.setProxyPort = function(s) {
|
||||||
|
this.proxyPort = s;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.open = function(url) {
|
||||||
|
SHELL.createProcess([
|
||||||
|
binPath,
|
||||||
|
"--profile-directory=" + this.profileName,
|
||||||
|
"--proxy-server=socks5://127.0.0.1:" + this.proxyPort,
|
||||||
|
url
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.start = function(url, proxyPort, profileName) {
|
||||||
|
var instance = new Chrome();
|
||||||
|
instance.setProfileName(profileName);
|
||||||
|
instance.setProxyPort(proxyPort);
|
||||||
|
instance.open(url);
|
||||||
|
};
|
||||||
|
|
|
@ -139,15 +139,9 @@ var XMLObject = function(dom) {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.create = function() {
|
|
||||||
return (new XMLObject()).getDOM();
|
|
||||||
};
|
|
||||||
exports.load = function(s) {
|
exports.load = function(s) {
|
||||||
return (new XMLObject()).load(s);
|
return (new XMLObject()).load(s);
|
||||||
};
|
};
|
||||||
exports.createElement = function(s) {
|
|
||||||
return (new XMLObject()).createElement(s);
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.VERSIONINFO = "XML interface (xml.js) version 0.1";
|
exports.VERSIONINFO = "XML interface (xml.js) version 0.1";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user