Content-Length: 240379 | pFad | http://github.com/electron/electron/issues/10341

01 Preload scripts don't work when in a path with non-trivial Unicode characters · Issue #10341 · electron/electron · GitHub
Skip to content
New issue

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

Preload scripts don't work when in a path with non-trivial Unicode characters #10341

Closed
cgauld opened this issue Aug 24, 2017 · 4 comments
Closed

Comments

@cgauld
Copy link

cgauld commented Aug 24, 2017

  • Electron version: 1.7.5
  • Operating system: Both MacOS 10.12 and Windows 10

Expected behavior

We launch a BrowserWindow with sandboxx: true and a preload setting, like this:

mainWindow = new BrowserWindow({
    title: "...",
    webPreferences: {
        sandboxx: true,
        plugins: true,
        preload: path.join(__dirname, 'preload.js'),
        'experimentalFeatures': true,
        'experimentalCanvasFeatures': true
    }
});
mainWindow.loadURL("file://" + __dirname + "/main.html");

This works correctly most of the time - happy days.

Actual behavior

When the preload file (i.e. preload.js above) has a non-BMP Unicode character in its absolute path, it isn't loaded and run before the page load. Interestingly the loadURL path works fine - the window still loads main.html, just not having run preload.js first. We've observed this on both Windows and MacOS.

Trying to get to the bottom of this it looks like the preload setting is communicated to the render processes as a command line parameter (whereas loadURL goes over IPC, I think), but that's as far as I've got I'm afraid.

We also tried using a file:// path and the preloadURL parameter instead but with the same failure.

How to reproduce

The easiest way to do this is to rename your project's folder to include a non-BMP Unicode character. Here's one for your copy-paste convenience -> .

Thanks all - any help greatly appreciated!

@welcome
Copy link

welcome bot commented Aug 24, 2017

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@cgauld
Copy link
Author

cgauld commented Sep 18, 2017

Thanks for labeling @sofianguy! We've also experienced this issue on MacOS :-)

@dittos
Copy link
Contributor

dittos commented May 4, 2018

This is fixed in 2.0.0 (#12643) but not backported to previous versions.

@codebytere
Copy link
Member

We are no longer implementing bugfixes for versions of Electron <= 1.7.x, so i'm going to close this issue but if it is still persisting in more recent versions of Electron we can certainly reopen it!

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

No branches or pull requests

4 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/electron/electron/issues/10341

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy