Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

[Bug]: path with # make api-demos blank #491

Closed
3 tasks done
7934345 opened this issue Mar 10, 2021 · 3 comments
Closed
3 tasks done

[Bug]: path with # make api-demos blank #491

7934345 opened this issue Mar 10, 2021 · 3 comments

Comments

@7934345
Copy link

7934345 commented Mar 10, 2021

Preflight Checklist

Electron Version

4.0.1

What operating system are you using?

Windows

Operating System Version

windows 10

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

electron can work in a path with #

Actual Behavior

window loads but with a blank page

Testcase Gist URL

No response

Additional Information

  1. download the demo app(version 2.0.2) from https://github.com/electron/electron-api-demos/releases
  2. extract the demo app both to desktop and a folder with #
  3. run the demo app in both on desktop and in the folder with #

and my app with electron 11.3.0 has the same as demo app.

pics informations:
1
2

and my app with electron 11.3.0 has the same as demo app.

@jkleinsc
Copy link
Member

@7934345 just to verify, are you saying this issue occurs in 11.3.0 as well?

@MarshallOfSound
Copy link
Member

This is actually a bug in the electron-api-demos project not in Electron itself. That project is calling loadURL with an unencoded file:// URL. If the path includes a # symbol naturally you need to URI encode it.

An alternative is to use loadFile(path) instead of loadURL(file://path)

Refs:

@MarshallOfSound MarshallOfSound transferred this issue from electron/electron Mar 11, 2021
@MarshallOfSound MarshallOfSound changed the title [Bug]: path with # make electron blank [Bug]: path with # make api-demos blank Mar 11, 2021
@7934345
Copy link
Author

7934345 commented Mar 11, 2021

@MarshallOfSound U save my ass and thx.
@jkleinsc yes, when 11.3.0 using loadURL(file://path) . And change loadURL to loadFile fix the blank page.

Thank you all and have a nice day!!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants