如何通过我的HTML中的href访问chrome-search://local-ntp/local-ntp.html

时间:2018-09-22 18:13:42

标签: google-chrome-extension

我正在开发一个chrome扩展程序,该扩展程序需要chrome_url_override新标签页。 newtab.html应包含chrome-search://local-ntp/local-ntp.html的链接。 我使用newtab.html中的chromeTab尝试了此操作,但是当我单击链接时,它没有响应。

manifest.json

{
"manifest_version": 2,
"name": "My First Extention",
 "version": "1.0",
 "description": "My new extention",
 "browser_action": {
"default_icon": "logo.png"
 },
 "chrome_url_overrides": {
  "newtab": "newtab.html"
},

 "permissions": [
   "activeTab"
 ]
 }

newtab.html

<!DOCTYPE html>
<html>
    <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>My Extension</title>
     <!-- Bootstrap -->
     <!-- Latest compiled and minified CSS -->
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
      <!-- jQuery library -->
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
     <!-- Latest compiled JavaScript -->
     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>    
     </head>
     <body>
      <a href="chrome-search://local-ntp/local-ntp.html"> Chrome Tab</a>

       </body>
  </html>

0 个答案:

没有答案