When I try my code out:
Testing.html -
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.