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

Weird popup in custom URL protocol #4746

Closed
sand123 opened this issue Apr 20, 2016 · 9 comments
Closed

Weird popup in custom URL protocol #4746

sand123 opened this issue Apr 20, 2016 · 9 comments
Assignees
Milestone

Comments

@sand123
Copy link

sand123 commented Apr 20, 2016

I implemented custom URL scheme myapp:https:// to handle internal links. When you click on such link for the first time, usually browser asks permission to handle custom link protocol. But in NW In 0.14.1 I've got this

nwscreen

Is it chromium or what?

@rogerwang
Copy link
Member

Could you please change the system locale to English and make another
screenshot so I can read the message? Thanks.

On Wed, Apr 20, 2016 at 1:51 PM sand123 [email protected] wrote:

I implemented custom URL scheme myapp:https:// to handle internal links. When
you click on such link for the first time, usually browser asks permission
to handle custom link protocol. But in NW In 0.14.1 I've got this

[image: nwscreen]
https://cloud.githubusercontent.com/assets/3256430/14664605/d360319e-06e5-11e6-9698-ea8f5ebb56c9.png

Is it chromium or what?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#4746

@rdtsc
Copy link

rdtsc commented Apr 20, 2016

@rogerwang: Below is a translated version (from ru-RU) of the dialog in question.

nwjs-ru-dialog-translated

Looks like most locale bundles except en-US contain these strings (or a localized version of them).

Russian (ru-RU)

~/dev/test/nwjs-v0.14.1-win-x64 $ grep -lri "пожаловать" # part of "welcome"
locales/ru.pak

French (fr-CA)

~/dev/test/nwjs-v0.14.1-win-x64 $ grep -lri "extraterrestre" # "alien"
locales/ca.pak

@rogerwang
Copy link
Member

Looks like the resource string is wrongly mapped to the default names given to a newly created profile:

https://github.com/nwjs/chromium.src/blob/nw14/chrome/app/generated_resources.grd#L10695

Will fix it soon.

@sand123
Copy link
Author

sand123 commented Apr 20, 2016

@rdtsc thanks for screen. I've used URL scheme successfully in 0.13.x branch - with requesting permission on first launch and appropriate alert

@rogerwang
Copy link
Member

@sand123 could you please provide a sample app?

@rogerwang rogerwang self-assigned this Apr 20, 2016
@rogerwang rogerwang added this to the 0.14.x milestone Apr 20, 2016
@sand123
Copy link
Author

sand123 commented Apr 20, 2016

@rogerwang sample.zip
Also notice that before running you should register myapp:https:// protocol handler - I included sample reg file inside archive with notepad.exe as destination app. Otherwise chromium won't do anything on clicking such links

@rdtsc
Copy link

rdtsc commented Apr 20, 2016

@rogerwang: Based on @sand123's sample app, the following behavior is observed when testing against v0.14.1 x64:

nwjs-protocol-handler-dialog-ss

SDK build is on the left, non-SDK (dist) build is on the right. Both instances were launched via:

nw.exe --lang=en-GB

Looks like all locales other than en-US are affected in the non-SDK builds.

Further, copying the locales dir from the SDK build to the non-SDK build seems to fix the issue and the correct resource strings start being selected:

@rogerwang
Copy link
Member

Thanks for the sample & the testing. It's very helpful to the fix.

@rogerwang
Copy link
Member

The root cause is that there is old locale files on the buid slave for the normal win build.

The locale files built and shipped in normal build are supposed to be only en-US.pak. Developers are supposed to copy locale files they want from SDK build. The old locale files were packaged with the new build.

For now the workaround is just replacing the pak files from SDK build. After deleting them in the build slave, the next nightly build should be fine.

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

No branches or pull requests

3 participants