我正在开发一个HTML项目,我无法找到如何在没有javascript的情况下在新选项卡中打开链接.
我已经知道<a href="http://www.WEBSITE_NAME.com"></a>在同一个标签中打开链接.有任何想法如何让它在新的开放?
如果内容是Blob,则广告拦截器会阻止所有打开的新标签页。我认为这背后有一些原因,但我无法弄清楚。我不认为blob有什么特别不安全的东西,否则浏览器本身会阻止它们,那么为什么广告阻止者甚至不选择查看它就这样做呢?
这是一个小提琴,因为使用Stack Overflows代码片段无法正常工作:
https://jsfiddle.net/Pharylon/dqjtha81/32/
const myString = "Hello World!";
const blob = new Blob([myString], {
type: 'text/plain'
});
const fileURL = URL.createObjectURL(blob);
const myLink = document.getElementById("blob-link");
myLink.setAttribute("href", fileURL);
myLink.style.display = "block";
document.getElementById("my-div").innerText = myLink;
Run Code Online (Sandbox Code Playgroud)
const myString = "Hello World!";
const blob = new Blob([myString], {
type: 'text/plain'
});
const fileURL = URL.createObjectURL(blob);
const myLink = document.getElementById("blob-link");
myLink.setAttribute("href", fileURL);
myLink.style.display = "block";
document.getElementById("my-div").innerText = myLink;
Run Code Online (Sandbox Code Playgroud)
https://jsfiddle.net/Pharylon/dqjtha81/32/
同样,我的问题是为什么阻滞剂会这样做。谢谢!