We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
19.0.1
Windows
Windows 7
x64
18.3.1
Electron will load page from local within registered protocol
Electron stuck on loading page
No response
Electron creates app window, creates tray, but can't load page. App registers a protocol for loading a local index file.
import { protocol } from "electron"; import { URL } from "url"; import path from "path"; const PRODUCTION_APP_PROTOCOL = "app"; // eslint-disable-next-line no-undef const PRODUCTION_APP_PATH = path.join(__dirname, "..", "renderer"); protocol.registerSchemesAsPrivileged([ { scheme: PRODUCTION_APP_PROTOCOL, privileges: { secure: true, standard: true } } ]); export default { register: () => { protocol.registerFileProtocol(PRODUCTION_APP_PROTOCOL, (request, callback) => { const pathname = path.normalize(new URL(request.url).pathname); const fullPath = path.join(PRODUCTION_APP_PATH, pathname); callback({ path: fullPath }); }); } };
And then load it (code below was simplified)
app.once("ready", () => { protocol.register(); window.loadURL("app://./index.html"); });
App don't load page on Windows 7. On Windows 10, Windows 11 and Linux distributions Electron 19 works well.
The text was updated successfully, but these errors were encountered:
It seems error caused by os.gethostname() Fixed in 20.2.0 (#35705)
os.gethostname()
Sorry, something went wrong.
No branches or pull requests
Preflight Checklist
Electron Version
19.0.1
What operating system are you using?
Windows
Operating System Version
Windows 7
What arch are you using?
x64
Last Known Working Electron version
18.3.1
Expected Behavior
Electron will load page from local within registered protocol
Actual Behavior
Electron stuck on loading page
Testcase Gist URL
No response
Additional Information
Electron creates app window, creates tray, but can't load page. App registers a protocol for loading a local index file.
And then load it (code below was simplified)
App don't load page on Windows 7. On Windows 10, Windows 11 and Linux distributions Electron 19 works well.
The text was updated successfully, but these errors were encountered: