我一直在尝试制作基本的Chrome扩展程序。现在,它应该只是将HTML页面的内容转储回弹出屏幕。由于端口80由另一个进程使用,我在端口8080上运行XAMPP服务器。下面是代码
的manifest.json
{
"manifest_version" : 2,
"name" : "Demo",
"description" : "Demo description",
"browser_action": {
"default_title":"Hello",
"default_popup":"pop.html"
},
"version": "1",
"permissions": [
"http://localhost/*"
]
}
pop.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset = "UTF-8">
<title></title>
</head>
<body>
<h3>Enter your details:</h3>
<form action="http://localhost:8080/db1/script.php" method="POST">
<input type = "text" name = "name" placeholder="Your name"><br>
<input type = "text" name="email" placeholder="Your email"><br>
<input type = "submit" value = "Go" name = "submit">
</form>
</body>
</html>
的script.php
<pre><?php
var_dump($_POST);
?>
</pre>
此处,Php脚本无法在扩展程序中运行。 但是,pop.html页面工作得非常好,但是当我尝试将其作为chrome扩展程序运行时,它并没有。任何帮助将不胜感激!谢谢!