Javascript 有没有解释为什么$jQuery或jQuery在chrome扩展开发中不起作用?

Javascript 有没有解释为什么$jQuery或jQuery在chrome扩展开发中不起作用?,javascript,jquery,google-chrome-extension,Javascript,Jquery,Google Chrome Extension,我已经在项目根目录中下载了jquery压缩版、生产版jquery 3.5.1 slim build文件,并添加到清单文件中,然后尝试使用$符号运行jquery函数,我尝试在内容脚本和背景脚本中执行此操作,但我得到了错误未捕获引用错误:$未定义 manifest.json "name": "Project", "version": "1.0", "description": "

我已经在项目根目录中下载了
jquery压缩版、生产版jquery 3.5.1 slim build
文件,并添加到清单文件中,然后尝试使用
$
符号运行jquery函数,我尝试在内容脚本和背景脚本中执行此操作,但我得到了错误
未捕获引用错误:$未定义

manifest.json

  "name": "Project",
  "version": "1.0",
  "description": "Lorem Ipsum is simply dummy text of the printing",
  "permissions": ["activeTab", "declarativeContent", "storage","https://*/"],
  "options_page": "options.html",
  "background": {
    "scripts": ["background.js","jquery.js"],
    "persistent": true
  },
  "page_action": {
    "default_popup": "popup.html",
    "default_icon": {
      "16": "images/get_started16.png",
      "32": "images/get_started32.png",
      "48": "images/get_started48.png",
      "128": "images/get_started128.png"
    }
  },

  "icons": {
    "16": "images/get_started16.png",
    "32": "images/get_started32.png",
    "48": "images/get_started48.png",
    "128": "images/get_started128.png"
  },

  "content_scripts":[{
      "matches" : ["https://www.amazon.com/s?*"],
      "js" : ["content.js","jquery.js"]
  }],

  "manifest_version": 2


}
content.js

chrome.runtime.sendMessage({productLink: 'test', search_url: url.href }, function(response) {
    console.log(`message from background: ${JSON.stringify(response)}`);
});

function isProductUrl(url){
    let arr = url.split('/');
    if(arr[4] == 'dp')
        return true;
    else
        return false;
}


$.ajax({
  url: "www.localhost.com/search",
  context: document.body
    }).done(function() {
  $( this ).addClass( "done" );
});


交换顺序:将
jquery.js
放在manifest.json的第一位。@wOxxOm非常感谢。你刚刚救了我的命!如果您使用的是slim构建,那么如果包含
ajax
方法,我会感到惊讶。