Skip to content

Commit

Permalink
Merge pull request #6 from talis/better-permissions
Browse files Browse the repository at this point in the history
Restrict to the permissions we actually need
  • Loading branch information
rsinger authored Jun 13, 2019
2 parents c43ae4f + 4915ff3 commit f8ecbda
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 50 deletions.
23 changes: 13 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
distdir: './dist',
copy: {
bower: {
dependencies: {
files: [
{
expand: true,
cwd: './',
cwd: './node_modules',
src: [
'bower_components/bootstrap/dist/js/bootstrap.min.js',
'bower_components/bootstrap/dist/css/bootstrap.min.css',
'bower_components/jquery/dist/jquery.min.js'
'bootstrap/dist/js/bootstrap.min.js',
'bootstrap/dist/css/bootstrap.min.css',
'jquery/dist/jquery.min.js'
],
dest: 'dist'
}
dest: 'dist/dependencies'
},
]
},
common: {
Expand Down Expand Up @@ -50,6 +49,9 @@ module.exports = function(grunt) {
manifest.version = grunt.config('pkg.version');
if (grunt.option('identifier')) {
manifest.applications = { 'gecko': { 'id': grunt.option('identifier') } };
delete manifest.options_page;
delete manifest.options_ui.chrome_style;
manifest.options_ui.browser_style = true;
}
if (dist === 'manifold') {
// manifoldjs requires a completely different icons schema for packaging edge extensions
Expand All @@ -61,6 +63,7 @@ module.exports = function(grunt) {
{"sizes":"176x176", "src": "images/icon176.png"},
];
manifest.permissions[0] = "tab";
manifest.permissions.push("*://*/*");
manifest.start_url = '';
manifest.scope = '/';
}
Expand All @@ -69,12 +72,12 @@ module.exports = function(grunt) {
grunt.registerTask(
'dist-common',
'Create distribution for Web Extension browsers',
['create-dist-dir', 'write-manifest:common', 'copy:bower', 'copy:common']
['create-dist-dir', 'write-manifest:common', 'copy:dependencies', 'copy:common']
);
grunt.registerTask(
'dist-manifold',
'Create distribution for Web Extension browsers',
['create-dist-dir', 'write-manifest:manifold', 'copy:bower', 'copy:common']
['create-dist-dir', 'write-manifest:manifold', 'copy:dependencies', 'copy:common']
);
grunt.registerTask('default', ['dist-common']);
};
24 changes: 0 additions & 24 deletions bower.json

This file was deleted.

8 changes: 1 addition & 7 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@
"page": "background.html",
"persistent": false
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["js/bookmarker.js"]
}
],
"permissions": [
"activeTab", "storage", "*://*/*", "https://talis-public.talis.com/talis.com/customers.json"
"activeTab", "storage", "https://talis-public.talis.com/*"
],
"options_ui": {
"page": "options.html",
Expand Down
10 changes: 5 additions & 5 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title data-message="optionsTitle">Talis Aspire Reading Lists Bookmarking Options</title>
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css" />
<script src="/dependencies/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" href="/dependencies/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="css/options.css" />
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="/dependencies/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="js/allTenants.js"></script>
<script src="js/tenants.js"></script>
<script src="js/options.js"></script>
Expand Down Expand Up @@ -35,8 +35,8 @@
<div class="col-xs-8">
<input type="text" id="tenantCode" />
</div>
</div>
</div>

</div>
</body>
</html>
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "talis-reading-lists-bookmarker",
"version": "0.3.0",
"version": "0.3.3",
"description": "A browser extension to bookmark resources to Talis Aspire Reading Lists",
"devDependencies": {
"bower": "^1.8.0",
"grunt": "^1.0.1",
"grunt-contrib-copy": "^1.0.0"
},
"scripts": {
"postinstall": "./node_modules/.bin/bower install"
"dependencies": {
"bootstrap": "^3.3.6",
"jquery": "^3.3.1"
}
}

0 comments on commit f8ecbda

Please sign in to comment.