gpt4 book ai didi

javascript - CRX 文件未下载

转载 作者:行者123 更新时间:2023-11-27 23:56:30 26 4
gpt4 key购买 nike

我在服务器上托管了一个 crx 文件。我的网页上有一个链接,可以将其下载到本地计算机上。

<a href="https://example.com/ext/test-1.0.0.crx" target="download_frame">Download</a>

<iframe id="download_frame" name="download_frame" src="about:Blank" style="width:0px; height:0px; overflow:hidden;" frameborder="0" scrolling="no">
</iframe>

<script type="text/javascript">
document.getElementById('download_frame').src="https://example.com/ext/test-1.0.0.crx";
</script>

但是单击链接后,没有任何反应。右键单击 -> 保存下载文件。

另外,

 * window.open("https://example.com/ext/test-1.0.0.crx");
* window.location = "https://example.com/ext/test-1.0.0.crx";
* window.location.href = "https://example.com/ext/test-1.0.0.crx";

所有这三种方式都可以在同一/新网页中将 crx 文件作为二进制编码文件打开。并且不下载文件

请指导如何下载该文件。

最佳答案

通过在 .htaccess 文件中添加以下行,为 crx 文件添加类型标识,我能够消除这种歧义:

AddType application/octet-stream crx CRX

关于javascript - CRX 文件未下载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32224328/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com