From 9a7100501455bc83d6c0849a61614828e6b24c6b Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 26 May 2020 10:54:47 +0200 Subject: [PATCH 1/2] Fix bad inline javascript usage --- frontend/service-settings.html | 4 ++-- frontend/settings.html | 2 +- frontend/ts/service-settings.ts | 7 ++++++- frontend/ts/settings.ts | 7 ++++++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/service-settings.html b/frontend/service-settings.html index 7ca53f7..bd0fd68 100644 --- a/frontend/service-settings.html +++ b/frontend/service-settings.html @@ -16,7 +16,7 @@ -
+

Loading...

@@ -78,7 +78,7 @@ diff --git a/frontend/settings.html b/frontend/settings.html index 2e7ef87..3ecc41d 100644 --- a/frontend/settings.html +++ b/frontend/settings.html @@ -17,7 +17,7 @@ - +

Settings

diff --git a/frontend/ts/service-settings.ts b/frontend/ts/service-settings.ts index 5b0ed7c..bbe591c 100644 --- a/frontend/ts/service-settings.ts +++ b/frontend/ts/service-settings.ts @@ -65,6 +65,11 @@ document.addEventListener('DOMContentLoaded', () => { remote.getCurrentWindow().close(); }); + document.querySelector('form')?.addEventListener('submit', e => { + e.preventDefault(); + save(); + }); + ipcRenderer.send('sync-settings'); document.getElementById('userAgentAutoFill')?.addEventListener('click', () => { @@ -170,7 +175,7 @@ function loadServiceValues() { } } -(window as any).save = () => { +function save() { let form = document.querySelector('form'); if (!form) return; const formData = new FormData(form); diff --git a/frontend/ts/settings.ts b/frontend/ts/settings.ts index 2d017c9..bc14c8d 100644 --- a/frontend/ts/settings.ts +++ b/frontend/ts/settings.ts @@ -36,7 +36,7 @@ ipcRenderer.on('updateStatus', (e, available, version) => { } }); -(window as any).save = () => { +function save() { let form = document.querySelector('form'); if (!form) return; const formData = new FormData(form); @@ -71,6 +71,11 @@ document.addEventListener('DOMContentLoaded', () => { remote.getCurrentWindow().close(); }); + document.querySelector('form')?.addEventListener('submit', e => { + e.preventDefault(); + save(); + }); + ipcRenderer.send('syncSettings'); ipcRenderer.send('checkForUpdates'); }); \ No newline at end of file From abfadfb199880c506832986e74edc78b029392ef Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 26 May 2020 10:55:00 +0200 Subject: [PATCH 2/2] Version 1.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7f38f7a..82368b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tabs", - "version": "1.0.0", + "version": "1.0.1", "description": "Persistent and separate browser tabs in one window.", "author": { "name": "Alice Gaudon",