我有一个 SVG,加载时间很短(大约 2-3)秒。那段时间,看起来有点好笑。无论如何,有没有办法告诉 SVG 何时完成渲染,以便我可以放置一个微调器或隐藏它或其他东西?
最佳答案
你说不出来。该限制是为了保障用户的安全。请参阅https://bugzilla.mozilla.org/show_bug.cgi?id=608030有关何时考虑在 Firefox 中进行此操作的更详细说明,但其他 UA 会得出相同的结论,因此您不可能在任何 UA 中执行此操作。
来自引用的错误...
Doing anything conditionally on the visitedness of a link seems dangerous. I haven't tried this, but suppose the attacker wants to know if the user has been to example.com. An attacker could set the href of a hyperlink to example.com, then navigate to example.com in a hidden iframe. If a MozAfterPaint event fires on the document where the hyperlink lives, you'd know the user hasn't been to www.example.com yet. Otherwise, they have.
关于svg - 如何判断 SVG 何时完成渲染,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10648693/