Skip to content

Commit 370d87a

Browse files
authored
Merge pull request #5 from codeeshop-oc/anant
updated docs and publish to chrome store for review
2 parents 00363f8 + ec7996d commit 370d87a

File tree

9 files changed

+19
-201
lines changed

9 files changed

+19
-201
lines changed

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,39 @@
11
# Custom HTML in Pages (custom-html-in-pages)
22

3-
Chrome Extension
3+
> Chrome Extension for adding Custom HTML code in Single Page, All Pages or Domains
4+
5+
[![Chrome](https://img.shields.io/badge/Chrome%20Extension-1.0.0-blue)](https://github.com/codeeshop-oc/custom-html-in-pages/blob/main/LICENSE)
6+
[![license](https://img.shields.io/badge/license-MIT-green)](https://github.com/codeeshop-oc/custom-html-in-pages/blob/main/LICENSE)
7+
[![PRs welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg)](https://github.com/codeeshop-oc/custom-html-in-pages/issues?&q=is%3Aissue+is%3Aopen)
8+
49

510
## Install the dependencies
611
```bash
712
yarn install
813
```
914

10-
### Start the app in development mode (hot-code reloading, error reporting, etc.)
15+
### 🚀 Start the app in development mode (hot-code reloading, error reporting, etc.)
1116
```bash
1217
quasar dev -m bex
1318
```
1419

1520
Follow the development procedure for chrome and firefox described here:
1621
[Quasar BEX Build Commands](https://quasar.dev/quasar-cli/developing-browser-extensions/build-commands)
1722

18-
### Build the app for production
23+
### 🚀 Build the app for production
1924
```bash
2025
quasar build -m bex
2126
```
2227

2328
Follow the production building tutorial here:
2429
[Quasar Production BEX Build Commands]](https://quasar.dev/quasar-cli/developing-browser-extensions/build-commands#Building-for-Production)
2530

26-
## What works as of now
31+
## Working
2732
Current tested in Chrome only. After installation you can browse to any URL and see the extension working.
2833
- A Popup will open when click on the Chrome Extension Icon
2934
- Fill the fields
3035

31-
32-
### All Props
36+
### 🚀 All Fields
3337

3438
| Field name | Description | Type | Values
3539
| ---------------------- | --------------------------------------------------------------------------| ------- | ---------------------
@@ -39,5 +43,10 @@ Current tested in Chrome only. After installation you can browse to any URL and
3943

4044
- See the result by inspecting ( Ctrl + Shift + F12 ) and check under head section.
4145

42-
### Customize the configuration
46+
### 🚀 Customize the configuration
4347
See [Configuring quasar.conf.js](https://quasar.dev/quasar-cli/quasar-conf-js).
48+
49+
50+
### 🔖 License
51+
52+
This software is licensed under the [MIT](https://github.com/codeeshop-oc/custom-html-in-pages/blob/main/LICENSE).

dist/bex/Packaged/chrome.pem

Lines changed: 0 additions & 28 deletions
This file was deleted.
-748 Bytes
Binary file not shown.
-748 Bytes
Binary file not shown.

dist/bex/UnPackaged/js/background-hooks.js

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,61 +5,6 @@
55

66
export default function attachBackgroundHooks(bridge /* , allActiveConnections */ ) {
77

8-
bridge.on('storage.get', event => {
9-
const payload = event.data
10-
if (payload.key === null) {
11-
chrome.storage.local.get(null, r => {
12-
const result = []
13-
14-
// Group the items up into an array to take advantage of the bridge's chunk splitting.
15-
for (const itemKey in r) {
16-
result.push(r[itemKey])
17-
}
18-
bridge.send(event.eventResponseKey, result)
19-
})
20-
} else {
21-
chrome.storage.local.get([payload.key], r => {
22-
bridge.send(event.eventResponseKey, r[payload.key])
23-
})
24-
}
25-
})
26-
27-
bridge.on('storage.set', event => {
28-
const payload = event.data
29-
chrome.storage.local.set({
30-
[payload.key]: payload.data
31-
}, () => {
32-
bridge.send(event.eventResponseKey, payload.data)
33-
})
34-
})
35-
36-
bridge.on('storage.remove', event => {
37-
const payload = event.data
38-
chrome.storage.local.remove(payload.key, () => {
39-
bridge.send(event.eventResponseKey, payload.data)
40-
})
41-
})
42-
43-
/*
44-
// EXAMPLES
45-
// Listen to a message from the client
46-
bridge.on('test', d => {
47-
console.log(d)
48-
})
49-
50-
// Send a message to the client based on something happening.
51-
chrome.tabs.onCreated.addListener(tab => {
52-
bridge.send('browserTabCreated', { tab })
53-
})
54-
55-
// Send a message to the client based on something happening.
56-
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
57-
if (changeInfo.url) {
58-
bridge.send('browserTabUpdated', { tab, changeInfo })
59-
}
60-
})
61-
*/
62-
638
chrome.tabs.query({
649
active: true
6510
}, function(tabs) {

dist/bex/UnPackaged/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name":"Custom HTML in Pages","description":"Adding Custom HTML code in Single Page, All Pages or Domains","version":"1.0.0","manifest_version":2,"icons":{"16":"icons/icon-16x16.png","48":"icons/icon-48x48.png","128":"icons/icon-128x128.png"},"browser_action":{"default_popup":"www/index.html#/popup"},"background":{"scripts":["www/js/bex-background.js","js/background.js"],"persistent":true},"content_scripts":[{"matches":["<all_urls>"],"js":["www/js/bex-content-script.js","js/content-script.js"],"css":["css/content-css.css"]}],"permissions":["<all_urls>","storage","tabs","activeTab"],"web_accessible_resources":["www/*","js/*","css/*","<all_urls>"],"content_security_policy":"script-src 'self' 'unsafe-eval'; object-src 'self';"}
1+
{"name":"Custom HTML in Pages","description":"Adding Custom HTML code in Single Page, All Pages or Domains","version":"1.0.0","manifest_version":2,"author":"Anant Negi","icons":{"16":"icons/icon-16x16.png","48":"icons/icon-48x48.png","128":"icons/icon-128x128.png"},"browser_action":{"default_popup":"www/index.html#/popup"},"background":{"scripts":["www/js/bex-background.js","js/background.js"],"persistent":true},"content_scripts":[{"matches":["<all_urls>"],"js":["www/js/bex-content-script.js","js/content-script.js"],"css":["css/content-css.css"]}],"permissions":["tabs"],"web_accessible_resources":["www/*","js/*","css/*","<all_urls>"],"content_security_policy":"script-src 'self' 'unsafe-eval'; object-src 'self';"}

dist/bex/UnPackaged/www/js/bex-background.js

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6263,57 +6263,6 @@ var web_url_search_params = __webpack_require__(6016);
62636263
function attachBackgroundHooks(bridge
62646264
/* , allActiveConnections */
62656265
) {
6266-
bridge.on('storage.get', event => {
6267-
const payload = event.data;
6268-
6269-
if (payload.key === null) {
6270-
chrome.storage.local.get(null, r => {
6271-
const result = []; // Group the items up into an array to take advantage of the bridge's chunk splitting.
6272-
6273-
for (const itemKey in r) {
6274-
result.push(r[itemKey]);
6275-
}
6276-
6277-
bridge.send(event.eventResponseKey, result);
6278-
});
6279-
} else {
6280-
chrome.storage.local.get([payload.key], r => {
6281-
bridge.send(event.eventResponseKey, r[payload.key]);
6282-
});
6283-
}
6284-
});
6285-
bridge.on('storage.set', event => {
6286-
const payload = event.data;
6287-
chrome.storage.local.set({
6288-
[payload.key]: payload.data
6289-
}, () => {
6290-
bridge.send(event.eventResponseKey, payload.data);
6291-
});
6292-
});
6293-
bridge.on('storage.remove', event => {
6294-
const payload = event.data;
6295-
chrome.storage.local.remove(payload.key, () => {
6296-
bridge.send(event.eventResponseKey, payload.data);
6297-
});
6298-
});
6299-
/*
6300-
// EXAMPLES
6301-
// Listen to a message from the client
6302-
bridge.on('test', d => {
6303-
console.log(d)
6304-
})
6305-
// Send a message to the client based on something happening.
6306-
chrome.tabs.onCreated.addListener(tab => {
6307-
bridge.send('browserTabCreated', { tab })
6308-
})
6309-
// Send a message to the client based on something happening.
6310-
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
6311-
if (changeInfo.url) {
6312-
bridge.send('browserTabUpdated', { tab, changeInfo })
6313-
}
6314-
})
6315-
*/
6316-
63176266
chrome.tabs.query({
63186267
active: true
63196268
}, function (tabs) {

src-bex/js/background-hooks.js

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,61 +5,6 @@
55

66
export default function attachBackgroundHooks(bridge /* , allActiveConnections */ ) {
77

8-
bridge.on('storage.get', event => {
9-
const payload = event.data
10-
if (payload.key === null) {
11-
chrome.storage.local.get(null, r => {
12-
const result = []
13-
14-
// Group the items up into an array to take advantage of the bridge's chunk splitting.
15-
for (const itemKey in r) {
16-
result.push(r[itemKey])
17-
}
18-
bridge.send(event.eventResponseKey, result)
19-
})
20-
} else {
21-
chrome.storage.local.get([payload.key], r => {
22-
bridge.send(event.eventResponseKey, r[payload.key])
23-
})
24-
}
25-
})
26-
27-
bridge.on('storage.set', event => {
28-
const payload = event.data
29-
chrome.storage.local.set({
30-
[payload.key]: payload.data
31-
}, () => {
32-
bridge.send(event.eventResponseKey, payload.data)
33-
})
34-
})
35-
36-
bridge.on('storage.remove', event => {
37-
const payload = event.data
38-
chrome.storage.local.remove(payload.key, () => {
39-
bridge.send(event.eventResponseKey, payload.data)
40-
})
41-
})
42-
43-
/*
44-
// EXAMPLES
45-
// Listen to a message from the client
46-
bridge.on('test', d => {
47-
console.log(d)
48-
})
49-
50-
// Send a message to the client based on something happening.
51-
chrome.tabs.onCreated.addListener(tab => {
52-
bridge.send('browserTabCreated', { tab })
53-
})
54-
55-
// Send a message to the client based on something happening.
56-
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
57-
if (changeInfo.url) {
58-
bridge.send('browserTabUpdated', { tab, changeInfo })
59-
}
60-
})
61-
*/
62-
638
chrome.tabs.query({
649
active: true
6510
}, function(tabs) {

src-bex/manifest.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"description": "Adding Custom HTML code in Single Page, All Pages or Domains",
44
"version": "1.0.0",
55
"manifest_version": 2,
6+
"author": "Anant Negi",
67
"icons": {
78
"16": "icons/icon-16x16.png",
89
"48": "icons/icon-48x48.png",
@@ -29,10 +30,7 @@
2930
]
3031
}],
3132
"permissions": [
32-
"<all_urls>",
33-
"storage",
34-
"tabs",
35-
"activeTab"
33+
"tabs"
3634
],
3735
"web_accessible_resources": [
3836
"www/*",

0 commit comments

Comments
 (0)