mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 18:09:58 +08:00
fix(electron): use another origin for popup to disable zoom in/out issue of the popup window (#11506)
fix AF-2473
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
export const mainWindowOrigin = 'file://.';
|
||||
export const onboardingViewUrl = `${mainWindowOrigin}${mainWindowOrigin.endsWith('/') ? '' : '/'}onboarding`;
|
||||
export const shellViewUrl = `${mainWindowOrigin}${mainWindowOrigin.endsWith('/') ? '' : '/'}shell.html`;
|
||||
export const backgroundWorkerViewUrl = `${mainWindowOrigin}${mainWindowOrigin.endsWith('/') ? '' : '/'}background-worker.html`;
|
||||
export const customThemeViewUrl = `${mainWindowOrigin}${mainWindowOrigin.endsWith('/') ? '' : '/'}theme-editor`;
|
||||
export const popupViewUrl = `${mainWindowOrigin}${mainWindowOrigin.endsWith('/') ? '' : '/'}popup.html`;
|
||||
export const mainHost = '.';
|
||||
export const anotherHost = 'another-host';
|
||||
|
||||
export const mainWindowOrigin = `file://${mainHost}`;
|
||||
export const anotherOrigin = `file://${anotherHost}`;
|
||||
|
||||
export const onboardingViewUrl = `${mainWindowOrigin}/onboarding`;
|
||||
export const shellViewUrl = `${mainWindowOrigin}/shell.html`;
|
||||
export const backgroundWorkerViewUrl = `${mainWindowOrigin}/background-worker.html`;
|
||||
export const customThemeViewUrl = `${mainWindowOrigin}/theme-editor.html`;
|
||||
|
||||
// mitigate the issue that popup window share the same zoom level of the main window
|
||||
// Notes from electron official docs:
|
||||
// "The zoom policy at the Chromium level is same-origin, meaning that the zoom level for a specific domain propagates across all instances of windows with the same domain. Differentiating the window URLs will make zoom work per-window."
|
||||
export const popupViewUrl = `${anotherOrigin}/popup.html`;
|
||||
|
||||
Reference in New Issue
Block a user