Re: [w3c/webcomponents] Make JavaScript Files a Valid Entry Point to a Web Page (#807)

> How would you know it exports a valid html document before running the code? 

If it is directly navigated to (and therefore not clicked on from a "view-source:https" page), my idea would be to scan for the "createHTMLDocument" string. If that string exists in the file, the browser would then run the code and only display a page if that script ultimately exports an html document. If the "createHTMLDocument" string is not located, then the browser could just display source code as usual.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/807#issuecomment-488106026

Received on Tuesday, 30 April 2019 20:38:24 UTC