在HREF中的视图源显示在控制台中的错误 [英] view-source in href shows error in console

查看:85
本文介绍了在HREF中的视图源显示在控制台中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< a href =view-source:http://stackoverflow.com>点击我< / a>



它曾经作为一个有效的 href 属性工作,但它似乎在过去的几个月里它现在在控制台显示错误(我正在使用Chrome):


不允许加载本地资源:view-source: http://stackoverflow.com


我发现了一些来自2013年的链接,它是固定的。



有人能指引我一个权威的来源,可以解释为什么这不再起作用吗?我认为这是浏览器的安全性,而不是角度问题(因为 view-source 被列入白名单并用于工作)

解决方案

在过去一年左右,Chrome和Firefox(至少)禁用了此功能。 href =https://bugzilla.mozilla.org/show_bug.cgi?id=1172165 =nofollow noreferrer> this thread ,and 这些发行说明解释了原因并提供了变更发生时间。






相关StackOverflow问题:文件URL不允许加载本地资源在互联网浏览器中


<a href="view-source:http://stackoverflow.com">Click Me</a>

This used to work as a valid href attribute but it seems in the past few months it now shows an error in the console (I'm using Chrome):

Not allowed to load local resource: view-source: http://stackoverflow.com

I found some links from 2013 where this was once a bug in Chrome but said it was fixed.

Could someone point me to an authoritative source that can explain why this no longer works? I assume that this is security by the browser and not an angular issue (since view-source is whitelisted and used to work)

解决方案

Looks like Chrome and Firefox (at least) disabled this within the past year or so

I found this thread, and these release notes explaining why and provides a timeline as to when the change took place.


Related StackOverflow question: File URL "Not allowed to load local resource" in the Internet Browser

这篇关于在HREF中的视图源显示在控制台中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆