无法在 firefox 附加输入字段中键入斜杠或单引号

Cannot type slash or single quote in firefox add-on input field

我正在学习开发 Firefox 附加组件。我制作了一个带有输入框的简单开发工具选项卡。我发现我可以在输入框中输入除“/”或“'”以外的所有字符。不会填充正斜杠或单引号。当我输入这些字符时,输入框中没有任何显示。

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    <style type="text/css">
  body{
    margin:0;
  }
  .warpath-search{
    width:100%;
    background-color:#fcfcfc;
    border:1px solid #f0f1f2;
    padding:.3em;
  }
  .warpath-search label{
    width:100px;
    display:inline-block;
  }
  .warpath-search input{
    width:400px;
  }
</style>
  </head>
  <body>
    <div class="warpath-search">
      <label>Xpath:</label><input type="text" name="warpath-xpath" id="warpath-xpath" />
    </div>    
    <script src="devtools-panel.js"></script>
  </body>
</html>

devtools-panel.js:

input = document.getElementById("warpath-xpath");
input.addEventListener("keyup", () => {
    console.log(input.value);
});

动图:

如果我直接在浏览器中加载插件的 HTML 文件,我可以输入字符,但是当它作为插件加载时,它被阻止了。 使用 Firefox:70.0.1(64 位)

这个问题似乎与 Firefox 的预先输入功能有关。以下步骤为我解决了这个问题:

  • 在浏览器中打开about:config
  • 点击"I accept the risk"
  • 搜索 "accessibility.typeaheadfind.manual"
  • 将此键的值从 "true" 更改为 "false"