You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Firefox中导航栏按钮触发随机文件名.htm下载问题求助

导航栏点击触发Firefox随机.htm文件下载问题

在网站导航栏点击按钮时,Firefox浏览器会频繁弹出下载对话框,生成文件名随机的.htm文件。该问题仅在Firefox中出现,Edge和Chrome无此异常;已在Windows 10/11系统的台式机、笔记本上复现,通常在多次点击或连续点击导航区域时触发。

问题相关素材

  • 问题示例图:Firefox下载随机.htm文件示例
  • 问题演示视频:原地址为 https://youtu.be/1wsT60dsZMQ
  • 相关HTML & CSS文件存储地址:原地址为 https://drive.google.com/drive/u/5/folders/1VjowILOkwZVCBFThXcLgAuZcukO-gEJ1

导航栏代码

CSS样式

/*creates the menu bar*/

.menulist {
  z-index: 2;
  display: flex;
  flex-direction: row;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  margin-top: 15px;
  box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.5);
  text-align: center;
  /*overflow: hidden;*/
  background-color: #2e2c27;
  border-style: solid;
  border-radius: 3px;
  border-left: none;
  border-right: none;
  border-top-width: 4px;
  border-bottom-width: 4px;
  border-color: antiquewhite;
  /*border-style: dotted;
        border-width: 5px;
        border-color: turquoise;*/
}

.menulist ul {
  overflow: visible;
}

.navbtn a {
  border-radius: 5px;
}

.menulist a {
  /*text-transform: capitalize;*/
  display: inline-block;
  text-align: center;
  padding: 10px;
  /*margin-bottom: 10.1em;*/
  font-family: "Arial", "Calibri", sans-serif;
  font-size: 125%;
}

.menulist a:link,
.menulist a:visited {
  text-decoration: none;
  color: white;
}

.menulist a.active {
  /* background-color: #ccded8; */
  color: white;
  border-bottom: .1em solid #ccded8;
}

.menulist input[type=search] {
  display: inline-block;
}

.menulist button {
  border-radius: 10%;
}

.menulist button:active {
  animation-name: button-hover;
  animation-duration: 100ms;
  animation-fill-mode: forwards;
}

@keyframes button-hover {
  50% {
    font-style: italic;
    transform: scale(1.08);
  }
  100% {
    font-style: italic;
    opacity: 0.4;
  }
}

.menulist li:link {
  text-decoration: none;
}

.menulist li:visited {
  text-decoration: none;
}

.menulist li:active {
  text-decoration: none;
}


/*The buttons and drop down menus on the menu bar*/

.dropdown {
  display: inline;
  overflow: hidden;
  font-size: 16px;
}

.navbtn {
  letter-spacing: 1px;
  font-size: 17px;
  height: 75.5px;
}

.dropdown .navbtn {
  border: none;
  outline: none;
  color: white;
  background-color: inherit;
  font-family: inherit;
  margin: 0;
}

.navbtn a {
  /*border: solid;
        border-width: 4px;
        border-color: blue;*/
}

.navbtn a:hover {
  animation-name: nav-hover;
  animation-duration: 220ms;
  animation-fill-mode: forwards;
}

.dropdown:hover .navbtn {
  /*background-color: #00134d;*/
  transition: .2s;
  border-radius: 1px;
  /*transition: 240ms;*/
}

@keyframes nav-hover {
  100% {
    background-color: burlywood;
  }
}

.dropdown-content {
  opacity: .995;
  border-radius: 2px;
  display: none;
  position: absolute;
  margin-left: .3%;
  background-color: #f9f9f9;
  min-width: inherit;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.dropdown-content a {
  float: none;
  background-color: orange;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.dropdown-content a:hover {
  background-color: #ddd;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.noselect {
  -webkit-touch-callout: none;
  /* iOS Safari */
  -webkit-user-select: none;
  /* Safari */
  -khtml-user-select: none;
  /* Konqueror HTML */
  -moz-user-select: none;
  /* Old versions of Firefox */
  -ms-user-select: none;
  /* Internet Explorer/Edge */
  user-select: none;
  /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}

HTML结构

<ul class="menulist">
  <div class="dropdown">
    <button class="navbtn" draggable="false" ondragstart="return false;">
      <a class="active noselect" href="index.html" draggable="false" ondragstart="return false;">About</a>
    </button>
    <div class="dropdown-content">
      <a href="index.html#aboutme" class="noselect" draggable="false" ondragstart="return false;">Me</a>
    </div>
  </div>
</ul>

已排查情况

  • 未安装或曾安装libredirect插件
  • 参考过Reddit上的类似讨论,原地址为 https://www.reddit.com/r/firefox/comments/tzredg/what_are_these_random_htm_files_that_firefox/

内容的提问来源于stack exchange,提问作者arlo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.21 13:27:17