且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用相对路径时无法加载chrome扩展程序内容脚本

更新时间:2023-12-05 20:09:52

如果脚本位于文件夹中,则扩展名应该可以正常工作.

The extension should work without problems if the scripts are in a folder.

您可以执行以下操作来解决此问题:

You may do the following to solve this:

  1. 尝试重新加载扩展.导航到 chrome://extensions/,然后点击扩展程序附近的 Reload 链接;
  2. 确保相对文件夹确实在扩展根目录中;
  3. 如果您使用的是扩展程序加载器和对 manifest.json 文件进行了一些修改,那么您必须手动将扩展名重新加载到 chrome://extensions/中.扩展程序重新加载程序不会从 manifest.json 重新加载更改,但是大部分内容脚本文件都会更改.
  1. Try to reloaded the extension. Navigate to chrome://extensions/ and click the Reload link near the extension;
  2. Be sure that the relative folders are really in the extension root directory;
  3. If you're using Extensions Reloader and made some modification to manifest.json file, then you must manually reload the extension in chrome://extensions/. Extensions Reloader does not reload changes from manifest.json, but mostly the content script file changes.