-
Notifications
You must be signed in to change notification settings - Fork 477
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
Multi-device Hybrid App Template + WinJS = buggy single page navigation #6 #718
Comments
This is a Multi-Device Hybrid App solution that is setup for single page navigation. It currently has the winstore-jscompat.js reference commented out (in the merges/windows/scripts/platformOverrides.js file) so that it actually works. To actually build the project for windows, you FIRST have to build it for Android to create the Debug bld folder. Then, you need to attempt to build the Windows version. It will fail with an expired key error. Follow the link below to get a new key, rename it, and copy it to the windows solution folder... build again and it will run. Once you see it work, then try to uncomment the winstore-jscompat stuff to see what happens... nothing :) |
@limefrogyank So you've worked around the key issue with the following: http://msopentech.com/blog/2014/11/11/cordova-certificate-issue-were-working-on-it/ correct? And now it seems that the winstore-jscompat shim isn't working for your application? |
Yes, the certificate issue is fine. I know how to fix that. The winstore-jscompat.js shim is making the navigation controller fail to return a rendered page when I navigate to a page. It seems to be adding some HTML that makes whatever reads the newly-generated HTML stop reading it and silently fail. All of the scripts on the page I'm trying to navigate to are local files. |
I did some digging into this. The problem is that the compat shim overrides setting innerHTML so that it cleans out unsafe things (such as script tags.) This means that in places in WinJS where we call "setInnerHTMLUnsafe" to explicitly allow unsafe HTML, the content will still be scrubbed. Naturally, this helper is used when loading fragments, since they may contain script references. This means that when the fragment loader tries to load your fragment, the There are a couple of workarounds:
It may be possible to fix this in the shim by trying to detect if you are already in "execUnsafeLocalFunction" mode or not before applying the cleaner, but I believe the only way to do this detection is to trigger an exception and catch it, which will likely have a negative impact on performance. |
Fixed by 19f41cc |
Recreating this issue here and tagging @jayrenn so it gets looked at: microsoft/winstore-jscompat#6
The text was updated successfully, but these errors were encountered: