将 Internet Explorer Java 脚本块作为 WPF 中的控件的解决方法
对于我的项目,我需要显示一个使用 JavaScript 呈现 LaTeX 代码的 html 文件。这工作得很好,但是每次我第一次在浏览器中打开这个文件时,黄色带都会弹出,表明活动代码在用户接受之前不会被执行。在这种情况下,这很烦人,尽管我理解其目的,但我想将我的代码标记为可信!您知道如何“破解”控件以实现我想要的行为吗?或者还有其他建议吗?
For my project I need to show a html file which uses JavaScript to render LaTeX code. This works fine, but everytime I open this file in the browser for the first time, the yellow band pops up that active code won't be executed until the user accepts so. This is annoying in this case, although I understand the purpose, however I want to mark my code as trusted! Do you have any idea how to "hack" the control to achieve the behavior I want? Or any other suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个解决方案真的很愚蠢,因为微软的安全策略执行得很糟糕。只需在其他内容之前添加注释
\r\n
,IE 就会将您的本地文件识别为从互联网访问的文件然后将根据需要执行 JavaScript 代码。但这是比破解注册表更好的解决方案......The solution ist really stupid as the security policy is badly implemented by Microsoft. Just add the comment
<!-- saved from url=(0014)about:internet -->\r\n
before everything else and the IE will recognize your local file as accessed from the internet and will then execute JavaScript code as wanted. But this is a better solution than hacking the registry...