Google Chrome Won't Accept .contentDocument or .contentWindow

前端 未结 3 509
隐瞒了意图╮
隐瞒了意图╮ 2021-01-06 19:06

When I try my code out:

Testing.html -



        
3条回答
  •  花落未央
    2021-01-06 19:45

    I've noticed that both the contentDocument and getSVGDocument (for svg objects from svg files) will work fine if the code is from a web server, but when I copy the code to a local file, it will not work.

    Here's a sample link with a code I coppied from which works on the web but not from my disk.

    Here's the solution I just found from Chrome (thanks to Artem S), i.e. using the --allow-file-access-from-files flag.

提交回复
热议问题