getSVGDocument returns null in FireFox and Chrome

后端 未结 2 899
被撕碎了的回忆
被撕碎了的回忆 2020-12-10 23:02

Is getSVGDocument broken? Obsolete?

Because when I \"run\" the following:




  

        
相关标签:
2条回答
  • 2020-12-10 23:15

    Found how to work around this, it's a security related issue.

    Chrome

    Close all running chrome instances first. Then start Chrome executable with a command line flag:

    chrome --allow-file-access-from-files

    On Windows, the easiest is probably to create a special shortcut which has added flag (right-click on shortcut -> properties -> target).

    Firefox

    Go to about:config Find security.fileuri.strict_origin_policy parameter Set it to false

    Got it there: https://github.com/mrdoob/three.js/wiki/How-to-run-things-locally

    0 讨论(0)
  • 2020-12-10 23:40

    The getSVGDocument() method is deprecated. The recommended way is to use the contentDocument attribute instead.

    See here

    0 讨论(0)
提交回复
热议问题