Chrome 扩展将 POST 请求发送到本地 HTTPS 地址而不是 HTTP

Chrome Extension sends POST request to local HTTPS address instead of HTTP

我正在构建一个 Chrome 扩展,它应该向我的本地站点(Apache Server HTTP 站点)发送一个 POST 请求,但我在尝试这样做时遇到错误。它发送数据到 https:// 即使我指定它被发送到 http://

在单击按钮时,我调用了 test2 函数。它告诉 AJAX 需要将数据发送到特定的 URL。当我单击该按钮时,出现此错误 SSL_ERROR

这是我的 popup.js 代码:

function test2(z,y) {
//makes sure that both parameters are present
if(z)
  console.log(z );
if(y)
  console.log(y );

//save data from POST in ff variable
ff = $("#frm");

//display all the information gathered from the extension popup, it works fine
console.log(ff);
console.log(ff.attr('id'));
console.log(ff.serialize());

//JQuery Ajax piece of code
$.ajax({
  type: 'POST',
  dataType:"json",
  crossDomain: true,
  //this is my local CakePHP website where I want to send data to
  url: 'http://land.register/register',
  data: ff.serialize(),
  method:'post' 
}).done(function( data ) {
    if ( console && console.log ) {
      console.log( "Sample of data:", data );
    }
  });}

我的 land.register\webroot\.httaccess 文件如下所示(我没有启用 HTTPS 或为我的本地网站提供证书)

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^ index.php [L]
</IfModule>

我的 manifest.json 看起来像这样:

{

"name": "KW Automatische",
"version": "0.1",
"manifest_version": 2,
"description": "Automatyzacja przeszukiwania KW",
"incognito": "spanning",
"content_security_policy": "script-src 'self' 'unsafe-inline' https://ajax.googleapis.com; object-src 'self'",

"browser_action": {
  "default_icon": "icon-40@2x.png",
  "default_popup": "popup.html",
"default_title": "Click here!"
},
"content_scripts": [
  {
    "matches": ["http://*/*"],
    "js": ["contentScript.js","jquery.js"]
  }
],
"background": {
  "scripts": ["background.js"]
},
"icons": {
  "16": "/images/book.png",
  "32": "/images/book.png",
  "48": "/images/book.png",
  "128": "/images/book.png"
},
"permissions": [
  "activeTab",
  "http://*/*","*://*/*",
  "notifications",
  "storage"
]}

已解决,我需要从 popup.html 文件中删除 <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">