htmlpreview / htmlpreview.github.com

HTML Preview for GitHub Repositories
htmlpreview.github.com
1.55k stars 312 forks source link

A Parser-blocking, cross-origin script ... error #45

Closed machineghost closed 8 years ago

machineghost commented 8 years ago

When I try to use your (awesome, thank you so much for coming up with this idea) HTML preview tool for the URL:

 http://htmlpreview.github.io/?https://github.com/jacomyal/sigma.js/blob/master/examples/custom-node-renderer.html

I get a blank page, with only the following warning in my dev tools:

htmlpreview.min.js:1 A Parser-blocking, cross-origin script, http://query.yahooapis.com/v1/public/yql?q=use%20%22https%3A%2F%2Fraw.githurenderer.html%22&format=json&diagnostics=true&callback=HTMLPreview.loadHTML, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity.

Since the HTML file I'm trying to view doesn't even contain the phrase yahoo, this appears to be a problem with the tool.

niutech commented 8 years ago

The problem with your page is that it is not a full HTML document (it does not have <html><head></head><body></body></html>), that is why it is rendered blank.

As for blocking document.write, this is being implemented in Chrome and it requires rewriting HTMLPreview in async manner.