Skip to content

Commit

Permalink
fix background functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr. Funk committed Jun 21, 2019
1 parent 5aaf73d commit afd9035
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.0.3

### fixes
* fix github render bug
* remove many uneeded permissions

## 0.0.2

### fixes
Expand Down
1 change: 0 additions & 1 deletion core/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ module.exports = {
// htmlPage('devtools', 'devtools', ['devtools']),
// htmlPage('options', 'options', ['options']),
htmlPage('background', 'background', ['background']),

new CopyWebpackPlugin([{ from: path.join(__dirname, '..', 'static') }]),
new ChromeReloadPlugin({
port: 9090,
Expand Down
22 changes: 20 additions & 2 deletions src/backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,26 @@ let backEnd = function () {
chrome.webNavigation.onHistoryStateUpdated.addListener(function (details) {
chrome.tabs.query({ 'active': true, 'lastFocusedWindow': true }, function (tabs) {
var url = tabs[0].url
if (url.indexOf("github.com") !== -1 || url.indexOf("bitbucket.org") !== -1) {
chrome.tabs.executeScript(null, { file: "js/inject.js" })
if (url && (url.indexOf("github.com") !== -1 || url.indexOf("bitbucket.org") !== -1)) {
// must inject manifest and vendor before running inject
chrome.tabs.executeScript(null, {
file: 'js/manifest.js',
runAt: 'document_end'},
function (result) {
console.log("done loading file manifest" + JSON.stringify(result))
})
chrome.tabs.executeScript(null, {
file: 'js/vendor.js',
runAt: 'document_end'},
function (result) {
console.log("done loading file vendor" + JSON.stringify(result))
})
chrome.tabs.executeScript(null, {
file: 'js/inject.js',
runAt: 'document_end'},
function (result) {
console.log("done loading file inject:" + JSON.stringify(result))
})
}
})
// if(chrome.runtime.lastError) {
Expand Down
14 changes: 9 additions & 5 deletions src/manifest-custom.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@

module.exports = {
name: 'Git Kanban Enhanced Self Hosted',
version: '0.0.2',
version: '0.0.3',
description: 'Kanban extensions for self hosted github, gitlab, bitbucket, and gitea',
author: "http://github.com/lastlink",
manifest_version: 2,
icons: { '16': 'icons/16.png', '128': 'icons/128.png' },
homepage_url: "https://github.com/funktechno/git-kanban-enhanced-chrome-extension",
permissions: [
'<all_urls>',
'*://*/*',
'tabs',
'background',
'contextMenus',
'storage',
Expand All @@ -23,20 +21,26 @@ module.exports = {
background: {
persistent: true,
"scripts": [
'js/manifest.js',
'js/vendor.js',
"js/background.js"
]
},
// devtools_page: 'pages/devtools.html',
// options_page: 'pages/options.html',
content_scripts: [{
js: [ 'js/inject.js' ],
js: [
'js/manifest.js',
'js/vendor.js',
'js/inject.js'
],
"exclude_matches": [
"*://extensions/*"
],
run_at: 'document_end',
matches: ['<all_urls>'],
all_frames: true
}],
content_security_policy: "script-src 'self' 'unsafe-eval'; object-src 'self'",
content_security_policy: "script-src 'self' 'unsafe-eval'; object-src 'self'"
// web_accessible_resources: [ 'js/content.js' ]
}
11 changes: 8 additions & 3 deletions src/manifest-main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

module.exports = {
name: 'Git Kanban Enhance',
version: '0.0.2',
version: '0.0.3',
description: 'Kanban extensions for github, gitlab, gitea, and bitbucket',
author: "http://github.com/lastlink",
manifest_version: 2,
Expand All @@ -12,7 +12,6 @@ module.exports = {
"*://bitbucket.org/*",
"*://gitlab.com/*",
"*://gitea.com/*",
'tabs',
'background',
'contextMenus',
'storage',
Expand All @@ -25,13 +24,19 @@ module.exports = {
background: {
persistent: true,
"scripts": [
'js/manifest.js',
'js/vendor.js',
"js/background.js"
]
},
// devtools_page: 'pages/devtools.html',
// options_page: 'pages/options.html',
content_scripts: [{
js: [ 'js/inject.js' ],
js: [
'js/manifest.js',
'js/vendor.js',
'js/inject.js'
],
"exclude_matches": [
"*://extensions/*"
],
Expand Down

0 comments on commit afd9035

Please sign in to comment.