@@ -6,7 +6,7 @@ the Bookmarks and Code Snippets Manager for Developers & Co.
6
6
## Install
7
7
This browser extension is available for:
8
8
9
- | ![ Chrome] ( docs /img/logo/chrome-48.png) | ![ Firefox] ( docs /img/logo/fx-48.png) |
9
+ | ![ Chrome] ( resources /img/logo/chrome-48.png) | ![ Firefox] ( resources /img/logo/fx-48.png) |
10
10
| :---:| :---:|
11
11
| [ Chrome] ( TODO-add-link-to-google-store ) | ![ Firefox] ( TODO-add-link-to-firefox-store ) |
12
12
@@ -18,7 +18,7 @@ Select code snippet && (right click || click on extension icon) to save it to [B
18
18
19
19
A popup window is launched where you can add additional metadata to the code snippet record.
20
20
21
- ![ Chrome extension screenshot] ( docs/img/gif/gif- save-snippet-via-chrome-extension-800.gif)
21
+ ![ Chrome extension screenshot] ( assets/images/ save-snippet-via-chrome-extension-800.gif)
22
22
23
23
> You need to have an account to save code to your code snippets
24
24
@@ -27,24 +27,40 @@ A popup window is launched where you can add additional metadata to the code sni
27
27
## Testing locally
28
28
Check out the git repository - ` git clone https://github.com/BookmarksDev/code-snippets-browser-extension `
29
29
30
- ### Chrome
30
+ ### Chrome/Brave
31
31
Go to [ chrome://extensions/] ( chrome://extensions/ ) , click ** Load unpacked** and select the ` code-snippets-browser-extension ` folder
32
32
where you have checked it out:
33
33
34
- ![ Install locally on chrome] ( docs/img /install-locally-and-reload-extension.png)
34
+ ![ Install locally on chrome] ( assets/images /install-locally-and-reload-extension-chrome .png)
35
35
36
36
> Click "Reload" on the extension when you do modifications
37
37
38
- ### Firefox
38
+ ###
39
+ #### Use [ web-ext] ( https://github.com/mozilla/web-ext )
40
+ The easiest way is to use [ web-ext] ( https://github.com/mozilla/web-ext )
41
+ You can install it globally for example via
42
+ ```
43
+ npm install --global web-ext
44
+ ```
45
+ and then run the following command in the root directory of the project
46
+
47
+ ```
48
+ web-ext run
49
+ ```
50
+
51
+ This installs "Save code to Bookmarks.dev" as a temporary add-on and it watches for changes in the source code
52
+ and ** redploys automatically** .
53
+
54
+ #### Manual deployment
39
55
Go to [ about: debugging #/runtime/this-firefox] ( about:debugging#/runtime/this-firefox ) , click ** Load Temporary Add-on...**
40
- and select the ` manifest.json ` file from the ` save- code-to-bookmarks.dev -browser-extension` folder where you have checked it out:
56
+ and select the ` manifest.json ` file from the ` code-snippets -browser-extension ` folder where you have checked it out:
41
57
42
- ![ Install locally on Firefox] ( docs/img /install-locally-and-reload-extension.png)
58
+ ![ Install locally on Firefox] ( assets/images /install-locally-and-reload-extension-firefox .png)
43
59
44
60
> Click "Reload" on the extension when you do modifications
45
61
46
62
### Test the extension against the [ ` localhost ` ] ( https://github.com/BookmarksDev/bookmarks.dev ) version of Bookmarks.dev
47
- Change the following line in [ launch-bookmarksdev-dialog.js] ( launch-bookmarksdev-dialog.js ) :
63
+ Change the ` host ` url in the following line from [ launch-bookmarksdev-dialog.js] ( launch-bookmarksdev-dialog.js ) :
48
64
```
49
65
const url = 'https://www.bookmarks.dev/my-codelets/new?sourceUrl=' + encodeURIComponent(l) + '&code=' + encodeURIComponent(d) + '&title=' + encodeURIComponent(t) + '&popup=true'
50
66
```
53
69
const url = 'http://localhost:4200/my-codelets/new?sourceUrl=' + encodeURIComponent(l) + '&code=' + encodeURIComponent(d) + '&title=' + encodeURIComponent(t) + '&popup=true'
54
70
```
55
71
56
- and Reload the extension
72
+ and then Reload the extension with one of the mechanisms mentioned before
57
73
58
74
## Publish browser extension to official stores
59
75
60
- ### Publish to Google Chrome Webstore
76
+ First of all zip the file either with ` web-ext `
77
+ ```
78
+ web-ext build -i 'docs'
79
+ ```
61
80
62
- First of all package it as a zip file:
63
- ``` shell
64
- zip -r bookmarks.dev.chrome.extension.zip * -x * .idea* * .git* ' *docs/*' " *README.md*"
81
+ or with _ standard_ ` zip ` command:
65
82
```
83
+ zip -r releases/code-snippets.bookmarks.dev.chrome.extension.zip * -x *.idea* *.git* '*resources/*' '*web-ext-artifacts/*'
84
+ ```
85
+
66
86
87
+ ### Publish to Google Chrome Webstore
67
88
Go to [ Chrome Webstore Dashboard] ( https://chrome.google.com/webstore/developer/dashboard ) where
68
89
you upload the .zip file. Wait for a couple of business days for an approval.
69
90
0 commit comments