diff options
author | mitsugu oyama | 2010-11-03 08:20:34 +0900 |
---|---|---|
committer | mitsugu oyama | 2010-11-03 08:20:34 +0900 |
commit | 261d7bedb18cc771c29ca571ce01a484274d1bd1 (patch) | |
tree | 30bcd86426fb5f884ee9d29d5f4ac95992ef1f9e /pixiv.js | |
parent | 71128ece701991b990aa530ad8e55ad5a8d22f9d (diff) | |
download | vimperator-plugins-261d7bedb18cc771c29ca571ce01a484274d1bd1.tar.bz2 |
Firefox 3.6.x を含む古いバージョンでのHTMLDocument作成方法を変更
Diffstat (limited to 'pixiv.js')
-rw-r--r-- | pixiv.js | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1,6 +1,6 @@ // INFO // var INFO = -<plugin name="pixiv.js" version="0.1" +<plugin name="pixiv.js" version="0.2" summary="pixiv.js" href="http://github.com/vimpr/vimperator-plugins/blob/master/pixiv.js" xmlns="http://vimperator.org/namespaces/liberator"> @@ -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); } |