Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
Update 1.2.9 (FUll)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwldom committed Aug 6, 2024
1 parent afd4b58 commit 546716b
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 30 deletions.
3 changes: 2 additions & 1 deletion browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
<input type="text" id="config-vibe" disabled>
<b>Bind Address Warp</b>
<input type="text" id="bind-warp">
<b>Endpoint </b>
<b>Endpoint Warp</b>
<input type="text" id="endpoint-warp">
</div>
<div id="content-menu-bookmark">

Expand Down
31 changes: 9 additions & 22 deletions browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var fs = require("fs");
const path = require("path");
var sect = "browser";
const { trackEvent } = require('@aptabase/electron/renderer');
var { StatusGuard, connectVibe, connectWarp, settingWarp, settingVibe, AssetsPath, ResetArgsVibe, ResetArgsWarp, testProxy, KillProcess, disconnectVibe } = require('./connect.js');
var { StatusGuard, connectVibe, connectWarp, settingWarp, settingVibe, AssetsPath, ResetArgsVibe, ResetArgsWarp, testProxy, KillProcess, disconnectVibe, saveSetting } = require('./connect.js');
// #endregion
// #region functions for public
function TabClose(idtab) {
Expand Down Expand Up @@ -153,26 +153,6 @@ document.getElementById("refresh-btn-header").addEventListener("click", function
ipc.send("load-url-browser", urlInput)
});
document.getElementById("close-browser").addEventListener("click", function () {
var settingWarp = {
proxy: "127.0.0.1:8086",
gool: false,
scan: false,
endpoint: "",
cfon: false,
cfonc: "IR",
ipver: 4,
warpver: "",
warpkey: "",
scanrtt: "",
verbose: false,
cache: "",
wgconf: "",
config: "",
reserved: "",
dns: "",
tun: false,
startup: "warp"
};
settingWarp = JSON.parse(read_file("warp.json"));
settingWarp["startup"] = "warp";
write_file("warp.json", JSON.stringify(settingWarp));
Expand Down Expand Up @@ -217,7 +197,11 @@ document.getElementById("core-vpn-selector").addEventListener("change", function
document.getElementById("config-vibe").addEventListener("change", function () {
settingBrowser["configVibe"] = document.getElementById("config-vibe").value;
settingVibe["config"] = document.getElementById("config-vibe").value;
ResetArgsVibe();
saveSetting();
});
document.getElementById("config-vibe").addEventListener("change", function () {
settingWarp["endpoint"] = document.getElementById("endpoint-warp").value;
saveSetting();
});
// #endregion
// #region define variables
Expand Down Expand Up @@ -272,5 +256,8 @@ ipc.on("set-title", (event, title) => {
document.getElementById("tab-title-" + currentTab).innerHTML = title.toString().length >= 15 ? title.slice(0, 20) : title;
});
// #endregion
setInterval(() => {
testProxy();
}, 10000);
testProxy();
trackEvent("start-browser");
20 changes: 18 additions & 2 deletions connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,21 @@ function ResetArgsVibe(config = "auto") {
argsVibe.push("--tun");
} else argsVibe.push("--system-proxy");
};
async function saveSetting() {
// Save setting vibe & setting warp In vibe.json & warp.json
write_file("vibe.json", JSON.stringify(settingVibe));
write_file("warp.json", JSON.stringify(settingWarp));
ResetArgsVibe();
ResetArgsWarp();
};
read_file = function (path) {
return fs.readFileSync(path, 'utf8');
}
write_file = function (path, output) {
fs.writeFileSync(path, output);
}
function ResetArgsWarp() {
savesett
argsWarp = [];
if (settingWarp["proxy"] != "127.0.0.1:8086" & settingWarp["proxy"] != "") {
argsWarp.push("--bind");
Expand Down Expand Up @@ -344,7 +358,8 @@ function ResetArgsWarp() {
}
if (settingWarp["tun"]) {
argsWarp.push("--tun-experimental");
}
};

};
// #endregion
// #region vars
Expand Down Expand Up @@ -400,5 +415,6 @@ module.exports = {
ResetArgsWarp,
KillProcess,
StatusGuard: StatusGuard,
disconnectVibe
disconnectVibe,
saveSetting
};
7 changes: 4 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@ function createWindow() {
mainWindow.loadFile("index.html");
mainWindow.on('resize', function () {
try {
ViewBrowser.setBounds({ x: 0, y: mainWindow.getBounds().height / 6, width: mainWindow.getBounds().width/1.3, height: mainWindow.getBounds().height / 1.5 });
ViewBrowser.setBounds({ x: 0, y: mainWindow.getBounds().height / 6, width: mainWindow.getBounds().width / 1.3, height: mainWindow.getBounds().height / 1.3 });
}
catch { };
});
};
setInterval(() => {
try {
ViewBrowser.setBounds({ x: 0, y: mainWindow.getBounds().height / 6, width: mainWindow.getBounds().width /1.3, height: mainWindow.getBounds().height / 1.5 });
ViewBrowser.setBounds({ x: 0, y: mainWindow.getBounds().height / 6, width: mainWindow.getBounds().width / 1.3, height: mainWindow.getBounds().height / 1.3 });
}
catch { };
},5000)
function CreateViewBrowser(url) {
ViewBrowser = new BrowserView();
mainWindow.setBrowserView(ViewBrowser);
ViewBrowser.setBounds({ x: 0, y: mainWindow.getBounds().height / 6, width: mainWindow.getBounds().width / 1.3, height: mainWindow.getBounds().height / 1.5 });
ViewBrowser.setBounds({ x: 0, y: mainWindow.getBounds().height / 6, width: mainWindow.getBounds().width / 1.3, height: mainWindow.getBounds().height / 1.3 });
ViewBrowser.setAutoResize({ width: true, height: true });
ViewBrowser.webContents.loadURL(url);
setTimeout(() => {
Expand Down Expand Up @@ -85,6 +85,7 @@ ipc.on('load-browser', (event) => {
mainWindow.webContents.send('set-url', (url));
});
mainWindow.maximize();
ViewBrowser.setBounds({ x: 10, y: mainWindow.getBounds().height / 6, width: mainWindow.getBounds().width, height: mainWindow.getBounds().height / 1.3 });
});
ipc.on('load-url-browser', (event, url) => {
ViewBrowser.webContents.loadURL(url);
Expand Down
1 change: 0 additions & 1 deletion one.one

This file was deleted.

2 changes: 1 addition & 1 deletion renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function Onload() {
else if (settingWarp["startup"] == "browser") {
setTimeout(() => {
ipc.send("load-browser", "");
}, 3500);
}, 1500);
}
}
trackEvent("start-warp");
Expand Down

0 comments on commit 546716b

Please sign in to comment.