Remove userscript support.

This commit is contained in:
The Ghost of FOSS' Past 2024-11-21 15:04:35 -06:00
parent 995962a497
commit dc9f6a45a6
4 changed files with 7 additions and 10 deletions

View file

@ -23,7 +23,6 @@
</tab-group>
</div>
<script src="node_modules/electron-tabs/dist/electron-tabs.js"></script>
<script type="text/javascript" src="./userscript/userscripts.js"></script>
<script type="text/javascript" src="./config.js"></script>
<script type="text/javascript" src="./libbrowz.js"></script>
</body>

View file

@ -77,11 +77,6 @@ function go() {
tabGroup.getActiveTab().setTitle(title)
console.log(title)
})
for (let i = 0; i < userscripts.length; i++) {
fetch(userscripts[i]).then( r => r.text() ).then( t => userscripts.executeJavaScript(t)).catch(() => {
console.log("Error loading userscripts! (Did you provide any?)")
})
}
}
function stop() {

10
main.js
View file

@ -55,6 +55,11 @@ function isLocal(url) {
}
function createWindow () {
try {
extensions = new ElectronChromeExtensions()
} catch {
console.log("Creating a new window in the same extension session...")
}
const mainWindow = new BrowserWindow({
width: 1100,
height: 600,
@ -70,8 +75,8 @@ function createWindow () {
}
})
const userDataPath = app.getPath('userData');
const extensionsDir = path.join(userDataPath, 'SneedExtensions');
const homePath = app.getPath('home');
const extensionsDir = path.join(homePath, 'SneedExtensions');
if (!fs.existsSync(extensionsDir)) {
fs.mkdirSync(extensionsDir, { recursive: true });
@ -216,7 +221,6 @@ app.on('window-all-closed', function () {
// Set DNS
app.on('ready', () => {
extensions = new ElectronChromeExtensions()
app.configureHostResolver({
mode: 'secure',
dohServers: [

View file

@ -1 +0,0 @@
var userscripts = [""]