Bookmarks saved to json added

This commit is contained in:
2025-07-31 21:33:58 +12:00
parent 870c52b4a6
commit 0f93274d84
8 changed files with 356 additions and 43 deletions
+11 -17
View File
@@ -56,25 +56,19 @@
</div>
</div>
<div id="webviews">
<webview id="webview" src="https://example.com"></webview>
<div id="webviews" class="hidden"></div>
<!-- Home page container for direct loading -->
<div id="home-container" class="active">
<webview id="home-webview"
src="home.html"
preload="../preload.js"
partition="persist:default"
allowpopups
style="width:100%; height:100%; border:none;">
</webview>
</div>
<script src="script.js"></script>
<script>
const { ipcRenderer } = require('electron');
const webview = document.getElementById('webview');
webview.addEventListener('did-navigate', (e) => {
// save site URL
ipcRenderer.invoke('save-site-history', e.url);
// extract search query if present
const m = /[?&](?:q|query)=([^&]+)/.exec(e.url);
if (m && m[1]) {
const query = decodeURIComponent(m[1].replace(/\+/g, ' '));
ipcRenderer.invoke('save-search-history', query);
}
});
</script>
</body>
</html>