mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-27 20:03:45 +03:00
Make manifest a common template
This commit is contained in:
parent
8441fd956e
commit
fce97347ff
|
@ -49,25 +49,16 @@ gulp.task('clean', function() {
|
|||
|
||||
});
|
||||
|
||||
const fullContext = {
|
||||
version: '0.21',
|
||||
nameSuffixEn: '',
|
||||
nameSuffixRu: '',
|
||||
};
|
||||
|
||||
const miniContext = Object.assign({}, fullContext, {
|
||||
nameSuffixEn: ' MINI',
|
||||
nameSuffixRu: ' МИНИ',
|
||||
});
|
||||
const contexts = require('./src/templates-data').contexts;
|
||||
|
||||
gulp.task('_cp-common', ['clean'], function() {
|
||||
|
||||
gulp.src(['./src/extension-common/**/*'])
|
||||
.pipe(templatePlugin(miniContext))
|
||||
.pipe(templatePlugin(contexts.mini))
|
||||
.pipe(gulp.dest('./build/extension-mini'))
|
||||
|
||||
gulp.src(['./src/extension-common/**/*'])
|
||||
.pipe(templatePlugin(fullContext))
|
||||
.pipe(templatePlugin(contexts.full))
|
||||
.pipe(gulp.dest('./build/extension-full'));
|
||||
|
||||
});
|
||||
|
@ -75,7 +66,7 @@ gulp.task('_cp-common', ['clean'], function() {
|
|||
gulp.task('_cp-mini', ['_cp-common'], function() {
|
||||
|
||||
gulp.src(['./src/extension-mini/**/*'])
|
||||
.pipe(templatePlugin(miniContext))
|
||||
.pipe(templatePlugin(contexts.mini))
|
||||
.pipe(gulp.dest('./build/extension-mini'));
|
||||
|
||||
});
|
||||
|
@ -83,7 +74,7 @@ gulp.task('_cp-mini', ['_cp-common'], function() {
|
|||
gulp.task('_cp-full', ['_cp-common'], function() {
|
||||
|
||||
gulp.src(['./src/extension-full/**/*'])
|
||||
.pipe(templatePlugin(fullContext))
|
||||
.pipe(templatePlugin(contexts.full))
|
||||
.pipe(gulp.dest('./build/extension-full'));
|
||||
|
||||
});
|
||||
|
|
|
@ -12,31 +12,31 @@
|
|||
"homepage_url": "https://github.com/anticensorship-russia/chromium-extension",
|
||||
|
||||
"permissions": [
|
||||
"proxy",
|
||||
"webRequest",
|
||||
"alarms",
|
||||
"storage",
|
||||
"<all_urls>",
|
||||
"tabs",
|
||||
"contextMenus",
|
||||
"notifications"
|
||||
"proxy"
|
||||
, "alarms"
|
||||
, "storage"
|
||||
, "<all_urls>"
|
||||
, "tabs"
|
||||
, "contextMenus"
|
||||
, "notifications"
|
||||
${extra_permissions}
|
||||
],
|
||||
|
||||
"background": {
|
||||
"scripts": [
|
||||
"00-init-apis.js",
|
||||
"11-error-handlers-api.js",
|
||||
"12-errors-lib.js",
|
||||
"13-http-lib.js",
|
||||
"14-ip-to-host-api.js",
|
||||
"15-pac-kitchen-api.js",
|
||||
"17-sync-pac-script-with-pac-provider-api.js",
|
||||
"30-block-informer.js",
|
||||
"40-context-menus.js"
|
||||
"00-init-apis.js"
|
||||
, "11-error-handlers-api.js"
|
||||
, "12-errors-lib.js"
|
||||
, "13-http-lib.js"
|
||||
${scripts_2x}
|
||||
, "35-pac-kitchen-api.js"
|
||||
, "37-sync-pac-script-with-pac-provider-api.js"
|
||||
${scripts_7x}
|
||||
, "80-context-menus.js"
|
||||
]
|
||||
},
|
||||
"browser_action": {
|
||||
"default_title": "Этот сайт благословлён | Версия ${version}",
|
||||
"default_title": "Этот сайт благословлён | Версия ${version + versionSuffix}",
|
||||
"default_popup": "/pages/choose-pac-provider/index.html"
|
||||
},
|
||||
"options_ui": {
|
|
@ -1,45 +0,0 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
|
||||
"name": "__MSG_extName__",
|
||||
"default_locale": "ru",
|
||||
"description": "__MSG_extDesc__",
|
||||
"version": "0.0.${version}",
|
||||
"icons": {
|
||||
"128": "/icons/default-128.png"
|
||||
},
|
||||
"author": "ilyaigpetrov@gmail.com",
|
||||
"homepage_url": "https://github.com/anticensorship-russia/chromium-extension",
|
||||
|
||||
"permissions": [
|
||||
"proxy",
|
||||
"alarms",
|
||||
"storage",
|
||||
"<all_urls>",
|
||||
"tabs",
|
||||
"contextMenus",
|
||||
"notifications"
|
||||
],
|
||||
|
||||
"background": {
|
||||
"persistent": false,
|
||||
"scripts": [
|
||||
"00-init-apis.js",
|
||||
"11-error-handlers-api.js",
|
||||
"12-errors-lib.js",
|
||||
"13-http-lib.js",
|
||||
"15-pac-kitchen-api.js",
|
||||
"17-sync-pac-script-with-pac-provider-api.js",
|
||||
"40-context-menus.js",
|
||||
"50-for-mini-only.js"
|
||||
]
|
||||
},
|
||||
"browser_action": {
|
||||
"default_title": "Этот сайт благословлён | Версия ${version}-mini",
|
||||
"default_popup": "/pages/choose-pac-provider/index.html"
|
||||
},
|
||||
"options_ui": {
|
||||
"page": "/pages/choose-pac-provider/index.html",
|
||||
"chrome_style": true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
'use strict';
|
||||
|
||||
const commonContext = {
|
||||
version: '0.21',
|
||||
};
|
||||
|
||||
exports.contexts = {};
|
||||
|
||||
exports.contexts.full = Object.assign({}, commonContext, {
|
||||
versionSuffix: '',
|
||||
nameSuffixEn: '',
|
||||
nameSuffixRu: '',
|
||||
extra_permissions: ', "webRequest"',
|
||||
scripts_2x: ', "20-ip-to-host-api.js"',
|
||||
scripts_7x: ', "70-block-informer.js"',
|
||||
});
|
||||
|
||||
exports.contexts.mini = Object.assign({}, commonContext, {
|
||||
versionSuffix: '-mini',
|
||||
nameSuffixEn: ' MINI',
|
||||
nameSuffixRu: ' МИНИ',
|
||||
extra_permissions: '',
|
||||
scripts_2x: ', "20-for-mini-only.js"',
|
||||
scripts_7x: '',
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user