Comments (14)
I fixed this issue in my fork: https://github.com/ClemMakesApps/winstore-jscompat
I would submit a pull request but I am not sure if this breaks anything else. I have only tested it in a few applications.
from winstore-jscompat.
I think a pull request would be great. Can you also sign the Contributor's License Agreement (CLA) for the project here - https://cla.msopentech.com/ ?
from winstore-jscompat.
Sure. I'll definitely do that. My company is busy during the holidays, so I probably won't be able to submit a pull request till January.
from winstore-jscompat.
Thanks for fixing this. I was going crazy trying to find out where the extra body tags were coming from. This was screwing up any component JS that was referencing document.body as it was pointing to the extra (empty) body tag. I'm looking forward to seeing this PR get into the master source.
from winstore-jscompat.
I created a fix in #11. @wbreza @Fishes can you give it a try?
from winstore-jscompat.
The fix works for the specified problem.
But in my project I include WinJS components and these fail with this fix.
Inititalizing the appBar and adding buttons fails at line 133:13 with the error Invallid pointer.
Sorry
from winstore-jscompat.
Looks like it works for elements that get injected under the body, but it doesn't work when elements are dynamically injected into the HEAD of the page.
For example, when using this with angular, the default style block that angular attempts to injects into the head of the page does not work.
I've created a pull request that fixed it for my case. Take a look and let me know if it looks good.
from winstore-jscompat.
@Fishes - Looks like there is a problem in AppBar specifically: winjs/winjs#899
@wbreza - How would that work if you are calling innerHTML on a documentElement? Your code will always strip out <body>
and <head>
tags.
from winstore-jscompat.
@xirzec - I haven't tested that case. I'll update again when I have some time to test it out.
from winstore-jscompat.
@wbreza - Can you give an example of what angular is doing to inject styles? I updated #11 with a guess, but I wasn't sure if they were injecting a tag like <style>
that document wants to group in <head>
but they wanted to put in the <body>
or something.
from winstore-jscompat.
@Fishes - I was wrong about it being an AppBar problem, the problem was actually because AppBar sets an empty string as innerHTML. I updated #11 to work around that as well.
from winstore-jscompat.
@xirzec - Take a look at the last line of Angular and you'll see they are finding the 'head' element and prepending a style block.
from winstore-jscompat.
@wbreza Thanks for the pointer. Yep, they're inserting a <style>
tag into a <div>
's innerHTML.
from winstore-jscompat.
@wbreza Alright! I think I have something workable in #11 - it works with Angular, it works with AppBar, it works with a simple div, it works with a new document element.
from winstore-jscompat.
Related Issues (20)
- i18next
- angular [object Object] in Angular WinPhone app HOT 1
- Style element when using Angular Material HOT 2
- Issue with Windows 8 App - Cordova OAuth2 opening Iframe or Redirect
- Cannot run OpenUI5+Cordova on Windows Phone
- Popovers are not poping up
- Popovers are not poping up
- Crashes with ReactCSSTransitionGroup
- Image and SVG image files are not loading properly. HOT 2
- TypeScript + Cordova + SystemJS HOT 1
- Run error at Windows Phone
- Additional problem with css properties
- tr and td tags removed on Windows 8.1 HOT 6
- Bower package? HOT 2
- 0x8000FFFF Javascript Runtime Error: Invalid Calling Object
- need NPM Package
- Script worked partially; onclick events still don't work HOT 1
- Performance issues HOT 2
- Call to native createContextualFragment fails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from winstore-jscompat.