如何创建chome扩展

时间:2016-02-29 06:17:17

标签: google-chrome google-chrome-extension

如何创建Chrome扩展程序? 段落只是一个或多个连续的文本行,由一个或多个空行分隔。 (空行是任何看起来像空行的行 - 除了空格或制表符之外的任何行都被视为空白。)正常段落不应使用空格或制表符缩进。

1 个答案:

答案 0 :(得分:-1)

步骤:

  1. 创建应用程序文件夹       例如:d:\ apps_folder \ app_01

  2. 在上面的app_01文件夹中创建manifest.json文件

      file content like this
    
    {   
        "manifest_version": 2,
        "name":"Give_Your_Extension",
        "description":"Give description about the Extension",
        "short_name":"Shot_Name_for_Extension",  
        "version": "0.1",
        "browser_action": {
                           "default_popup": "Home.html",
                           "default_icon" : "images/logo.png"
                          },   "permissions": [ ],
       "content_security_policy": "script-src 'self' 'unsafe-eval';
                                   object-src  'self'" 
    

    }

  3. 创建Home.html 放置你想要的内容  例如:
  4. // main.min.js
    
    
    var app = angular.module('myApp', []);
    
    app.controller('myCtrl', function($scope) {
    
      $scope.tabs = [{}]
      $scope.winID = "";
      $scope.td = new Date();
    
      $scope.ping = function() {
    
        } // end ping method code
    });
    <!DOCTYPE html>
    <html>
    <style type="text/css">
      th {
        background-color: Green;
        color: #FFFFFF;
      }
    </style>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
    <!-- <script src="js/angular.min.js"></script> -->
    <script src="js/main.min.js"></script>
    
    <body>
    
      <div ng-app="myApp" ng-controller="myCtrl">
    
        Window ID: {{winID}}
    
        <hr>
    
        <button ng-click="ping()">ping</button>
        <br>Length:{{tabs.length}}
        <br>
    
        <table border='1'>
          <tr>
            <th>DATE</th>
            <th>WINDOW_ID</th>
            <th>TAB_ID</th>
            <th>TAB_INDEX</th>
            <th>TAB_URL</th>
          </tr>
          <tr ng-repeat="x in tabs">
            <td>{{td|date:"yyyy/MM/dd '_' hh:mm:ss a"}}</td>
            <td>{{winID}}</td>
            <td>{{x.id}}</td>
            <td>{{x.index}}</td>
            <td>{{x.url}}</td>
          </tr>
        </table>
    
      </div>
    
    
    </body>
    
    </html>

    1. 在app_01 \ images中创建图像文件夹,然后输入logo png