Migrate to WebExtension for FireFox
This commit is contained in:
GyuYong Jung 2017-07-18 01:23:21 +09:00 committed by Buu Nguyen
parent 770e1e145f
commit 3b56842679
4 changed files with 40 additions and 47 deletions

View File

@ -21,7 +21,7 @@ gulp.task('default', ['build'], () => {
})
gulp.task('dist', ['build'], (cb) => {
$.runSequence('firefox:xpi', 'chrome:zip', 'chrome:crx', 'opera:nex', cb)
$.runSequence('firefox:zip', 'chrome:zip', 'chrome:crx', 'opera:nex', cb)
})
gulp.task('test', ['build'], (cb) => {
@ -111,15 +111,15 @@ gulp.task('firefox:js', ['firefox:template', 'lib:ondemand'], () => {
gulp.task('firefox', ['firefox:js'], () => {
return merge(
pipe('./icons/**/*', './tmp/firefox/data/icons'),
pipe(['./libs/**/*', '!./libs/ondemand{,/**}', './tmp/octotree.*', './tmp/ondemand.js'], './tmp/firefox/data'),
pipe('./src/config/firefox/firefox.js', $.babel(), './tmp/firefox/lib'),
pipe('./src/config/firefox/package.json', $.replace('$VERSION', version), './tmp/firefox')
pipe('./icons/**/*', './tmp/firefox/icons'),
pipe(['./libs/**/*', '!./libs/ondemand{,/**}', './tmp/octotree.*', './tmp/ondemand.js'], './tmp/firefox'),
pipe('./src/config/firefox/background.js', $.babel(), './tmp/firefox/'),
pipe('./src/config/firefox/manifest.json', $.replace('$VERSION', version), './tmp/firefox')
)
})
gulp.task('firefox:xpi', (cb) => {
$.run('cd ./tmp/firefox && ../../node_modules/.bin/jpm xpi && mkdir -p ../../dist && mv jid1-Om7eJGwA1U8Akg*.xpi ../../dist/firefox.xpi').exec(cb)
gulp.task('firefox:zip', () => {
return pipe('./tmp/firefox/**/*', $.zip('firefox.zip'), './dist')
})
// Safari

View File

@ -1,17 +0,0 @@
const data = require('sdk/self').data
const pageMod = require('sdk/page-mod')
pageMod.PageMod({
include: ['https://bitbucket.org/*', 'https://github.com/*'],
contentScriptFile : [data.url('jquery.js'),
data.url('jquery-ui.js'),
data.url('jstree.js'),
data.url('keymaster.js'),
data.url('ondemand.js'),
data.url('octotree.js')
],
contentStyleFile : [data.url('jstree.css'),
data.url('octotree.css')
],
contentScriptWhen : 'start'
})

View File

@ -0,0 +1,33 @@
{
"name": "Octotree",
"version": "$VERSION",
"manifest_version": 2,
"author": "Buu Nguyen",
"description": "Code tree for GitHub",
"homepage_url": "https://github.com/buunguyen/octotree",
"icons": {
"48": "icons/icon48.png",
"64": "icons/icon64.png"
},
"permissions": [
"https://*.github.com/*",
"storage"
],
"content_scripts": [
{
"matches": ["https://github.com/*"],
"js": [
"jquery.js",
"jquery-ui.js",
"jstree.js",
"keymaster.js",
"ondemand.js",
"octotree.js"
],
"css": [
"jstree.css",
"octotree.css"
]
}
]
}

View File

@ -1,23 +0,0 @@
{
"name": "octotree",
"title": "Octotree",
"id": "jid1-Om7eJGwA1U8Akg@jetpack",
"description": "Code tree for GitHub",
"author": "Buu Nguyen",
"homepage": "https://github.com/buunguyen/octotree",
"main": "lib/firefox",
"icon": "resource://jid1-Om7eJGwA1U8Akg-at-jetpack/data/icons/icon48.png",
"icon64": "resource://jid1-Om7eJGwA1U8Akg-at-jetpack/data/icons/icon64.png",
"license": "MIT",
"version": "$VERSION",
"permissions": {
"cross-domain-content": [
"https://api.bitbucket.org",
"https://api.github.com",
"https://bitbucket.org",
"https://github.com"
],
"private-browsing": true,
"multiprocess": true
}
}