From 261d7bedb18cc771c29ca571ce01a484274d1bd1 Mon Sep 17 00:00:00 2001 From: mitsugu oyama Date: Wed, 3 Nov 2010 08:20:34 +0900 Subject: Firefox 3.6.x を含む古いバージョンでのHTMLDocument作成方法を変更 --- pixiv.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'pixiv.js') diff --git a/pixiv.js b/pixiv.js index 2e0e9d3..ba0e9b1 100644 --- a/pixiv.js +++ b/pixiv.js @@ -1,6 +1,6 @@ // INFO // var INFO = - @@ -69,9 +69,14 @@ commands.addUserCommand( range.deleteContents(); doc.documentElement.appendChild(range.createContextualFragment(str)); }else{ - doc=document.implementation.createDocument(null,'html',null); - range=document.createRange(); - range.selectNodeContents(document.documentElement); + let doctype=document.implementation.createDocumentType( + 'html', + '-//W3C//DTD HTML 4.01 Transitional//EN', + 'http://www.w3.org/TR/html4/loose.dtd' + ); + doc=document.implementation.createDocument(null,'html',doctype); + range=doc.createRange(); + range.selectNodeContents(doc.documentElement); let content=doc.adoptNode(range.createContextualFragment(str)); doc.documentElement.appendChild(content); } -- cgit v1.2.3