谷歌浏览器扩展不显示 PHP 代码

时间:2021-03-14 08:27:12

标签: javascript php html google-chrome-extension

我制作了一个需要 PHP 的 Chrome 扩展

Manifest.json :

{
"manifest_version": 2,
"name": "Website Blocker",
"version": "1.0.1",
"description": "Website Blocker is an extension, Which allows you to block certain websites. It also Blocks Certain Websites based on your age. These information Will , be Sold and will be stored in a Hash Method for the best Security.",
"author": "Ryan Da Ghost",

"icons": {
    "120": "blocker.png"
},

"browser_action": {
    "default_icon": "blocker.png",
    "default_title": "Website Blocker Settings",
    "default_popup": "popup.php"
},

"permissions": ["activeTab", "tabs"],

"background": {
    "scripts": ["main.js"]
}

}

popup.php:

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Website Blocker</title>
</head>

<body>
  <h1>Website Hi</h1>
  <hr />

  <span><a href="" target="_blank">It seems You haven't Logged In!</a></span>

  <?php echo "Hello world"; ?>
</body>

</html>

我看到返回值为 NULL,我什么也没看到。 谁能告诉我这是怎么回事?

我怀疑 Google Chrome / Firefox / Edge 没有支持 PHP 代码的引擎。我很想解决这个问题,或者只是在后台看到这个,因为我需要连接到数据库并从他们那里获取数据。我可以返回一个值并在 JavaScript 代码中检查它。

0 个答案:

没有答案