Skip to content

Commit

Permalink
fix: use better fix for "Update Google Chrome" issue
Browse files Browse the repository at this point in the history
thanks to @Tokarak
  • Loading branch information
amanharwara committed Nov 2, 2022
1 parent 143c045 commit 4b09de9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
6 changes: 0 additions & 6 deletions src/components/WebView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
export let partition;
export let tab: TabType;
const userAgent = window.navigator.userAgent.replace(
/(Altus|Electron)([^\s]+\s)/g,
""
);
let webviewElement;
let hasStoppedLoading = false;
Expand Down Expand Up @@ -53,7 +48,6 @@
preload="../src/preload.js"
{partition}
bind:this={webviewElement}
useragent={userAgent}
webpreferences={`spellcheck=${tab.config.spellChecker ? 1 : 0}`}
nodeintegration
/>
9 changes: 6 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const exportSettings = require("./ipcHandlers/main/exportSettings");
const promptCloseTab = require("./ipcHandlers/main/promptCloseTab");
const pruneUnusedPartitions = require("./util/pruneUnusedPartitions");
const clearCache = require("./util/clearCache");
const flushSessionData = require("./ipcHandlers/main/flushSessionData");
const zoom = require("./ipcHandlers/main/zoom");
const contextMenu = require("electron-context-menu");
const handleWhatsappLinks = require("./util/handleWhatsappLinks");
Expand Down Expand Up @@ -161,6 +160,12 @@ if (!singleInstanceLock) {
});

app.on("ready", () => {
const userAgentFallback = app.userAgentFallback;
app.userAgentFallback = userAgentFallback.replace(
/(Altus|Electron)([^\s]+\s)/g,
""
);

if (app.isPackaged) app.setAsDefaultProtocolClient("whatsapp");

createMainWindow();
Expand Down Expand Up @@ -237,8 +242,6 @@ if (!singleInstanceLock) {

ipcMain.on("prompt-close-tab", promptCloseTab);

ipcMain.on("flush-session-data", flushSessionData);

ipcMain.on("zoom", zoom);

ipcMain.on("clear-cache", (_, tabId) =>
Expand Down
9 changes: 0 additions & 9 deletions src/ipcHandlers/main/flushSessionData.js

This file was deleted.

2 changes: 0 additions & 2 deletions src/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ const { ipcRenderer } = require("electron");
const dispatchMouseEvents = require("./util/webview/dispatchMouseEvents");
const formatSelectedText = require("./util/webview/formatSelectedText");

ipcRenderer.send("flush-session-data");

window.onload = () => {
const title_element = document.querySelector(".landing-title");
if (title_element && title_element.innerHTML.includes("Google Chrome")) {
Expand Down

0 comments on commit 4b09de9

Please sign in to comment.