开发者

Fix missing HTML tags using Greasemonkey userscript

开发者 https://www.devze.com 2023-02-12 18:41 出处:网络
I need to open a web page that is somehow missing <html>...</html>. That is, the page content is only:

I need to open a web page that is somehow missing <html>...</html>. That is, the page content is only:

<head>
 ...
</head>
<b开发者_开发知识库ody>
 ...
</body>

without the enclosing HTML tags.

Firefox is willing to render this page, but not Chrome. I want to use userscript to fix it.

But since head and body has no parent, I can't insert anything before&after them.

Any idea how to do it? Thanks!


I don't think this will solve your issue or not. Please try this using jQuery :

$(document).ready(function(html){
       html = '<html>' + html + '</html>';
});

where html is the page without html tags.

See this.

0

精彩评论

暂无评论...
验证码 换一张
取 消