简体   繁体   中英

Using polymer for apache cordova windows app

I was playing around with building an apache cordova app for windows but also using the new polymer that google built. I have no problem running the basic app that is created for windows by cordova in the emulator. I also have no problem running a simple polymer version on my localhost in chrome. However, when I try to run that simple polymer version in the emulator, I run into problems.

Here is the first error I run into at this line originalInsertBefore.call(unsafeUnwrap(this), unwrap(childWrapper), refNode); in the webcomponents.js file:

"Unhandled exception at line 1801, column 15 in ms-appx://com.test.testing/www/bower_components/webcomponentsjs/webcomponents.js

0x800c001c - JavaScript runtime error: Unable to add dynamic content. A script attempted to inject dynamic content, or elements previously modified dynamically, that might be unsafe. For example, using the innerHTML property to add script or malformed HTML will generate this exception. Use the toStaticHTML method to filter dynamic content, or explicitly create elements and attributes with a method such as createElement. For more information, see http://go.microsoft.com/fwlink/?LinkID=247104 ".

Now I googled this and saw that MS had put in that loading in dynamic content was not allowed but that apparently there was a fix which is the below:

 MSApp.execUnsafeLocalFunction(function () {
    originalInsertBefore.call(unsafeUnwrap(this), unwrap(childWrapper), refNode);
 });

This results in getting past that first error but instead results in this:

"Unhandled exception at line 293, column 7 in ms-appx://com.asquared.packinglist/www/bower_components/webcomponentsjs/webcomponents.js

0x800a138f - JavaScript runtime error: Unable to get property ' impl4cf1e782hg ' of undefined or null reference"

at this line:

function unsafeUnwrap(wrapper) {
  return wrapper.__impl4cf1e782hg__;
}

I don't actually have much experience with windows apps, so I'm not really certain about the difference between windows 8.1 apps vs windows 8.1 phone apps and "store" apps but currently I'm just trying to run it on "Local Machine" in visual studio.

Has anyone run into this before? I realize that polymer is very new tech so there might not be much out there but any help would be appreciated.

Thanks,

Use the following fix to get rid of this security error: https://github.com/MsopenTech/winstore-jscompat

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM