mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +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:
@@ -4,6 +4,7 @@ import { app, net, protocol, session } from 'electron';
|
||||
import cookieParser from 'set-cookie-parser';
|
||||
|
||||
import { resourcesPath } from '../shared/utils';
|
||||
import { anotherHost, mainHost } from './constants';
|
||||
import { logger } from './logger';
|
||||
|
||||
protocol.registerSchemesAsPrivileged([
|
||||
@@ -43,6 +44,10 @@ function isNetworkResource(pathname: string) {
|
||||
async function handleFileRequest(request: Request) {
|
||||
const urlObject = new URL(request.url);
|
||||
|
||||
if (urlObject.host === anotherHost) {
|
||||
urlObject.host = mainHost;
|
||||
}
|
||||
|
||||
const isAbsolutePath = urlObject.host !== '.';
|
||||
|
||||
// Redirect to webpack dev server if defined
|
||||
|
||||
Reference in New Issue
Block a user