Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions dev/local-serve.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/manifest.json b/manifest.json
index 9e964097..52c4119c 100644
--- a/manifest.json
+++ b/manifest.json
@@ -33,7 +33,7 @@
"author": "New XKit Team",
"permissions": ["storage", "unlimitedStorage", "*://*.tumblr.com/*", "https://new-xkit.github.io/XKit/*", "https://cloud.new-xkit.com/*" ],
"version": "7.9.2",
- "web_accessible_resources": [ "manifest.json", "editor.js" ],
+ "web_accessible_resources": [ "*.json", "editor.js" ],
"applications": {
"gecko": {
"id": "@new-xkit",
diff --git a/xkit.js b/xkit.js
index d5b0cfd8..719402e1 100755
--- a/xkit.js
+++ b/xkit.js
@@ -192,7 +192,7 @@ var xkit_global_start = Date.now(); // log start timestamp
download: {
// TODO: implement as module, lose most of this code
github_fetch: function(path, callback) {
- var url = 'https://new-xkit.github.io/XKit/Extensions/dist/' + path;
+ var url = browser.runtime.getURL('/Extensions/dist/') + path;
GM_xmlhttpRequest({
method: "GET",
url: url,
36 changes: 4 additions & 32 deletions docs/contributing/Build-XKit.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,38 +34,10 @@ After performing these steps, edits can be made to the XKit core files in your l
Serving extensions locally is useful for rapid development without requiring the use of the XKit Editor, but some additional setup is required:

1. Run `npm run watch-extensions` to start the resource server. This task will automatically build the extension and theme files from source whenever they are changed, storing them in `Extensions/dist`.
2. Change these lines in xkit.js and manifest.json to point the XKit updater at `Extensions/dist`:

```diff
diff --git a/manifest.json b/manifest.json
index 9e964097..52c4119c 100644
--- a/manifest.json
+++ b/manifest.json
@@ -33,7 +33,7 @@
"author": "New XKit Team",
"permissions": ["storage", "unlimitedStorage", "*://*.tumblr.com/*", "https://new-xkit.github.io/XKit/*", "https://cloud.new-xkit.com/*" ],
"version": "7.9.2",
- "web_accessible_resources": [ "manifest.json", "editor.js" ],
+ "web_accessible_resources": [ "*.json", "editor.js" ],
"applications": {
"gecko": {
"id": "@new-xkit",
diff --git a/xkit.js b/xkit.js
index d5b0cfd8..719402e1 100755
--- a/xkit.js
+++ b/xkit.js
@@ -192,7 +192,7 @@ var xkit_global_start = Date.now(); // log start timestamp
download: {
// TODO: implement as module, lose most of this code
github_fetch: function(path, callback) {
- var url = 'https://new-xkit.github.io/XKit/Extensions/dist/' + path;
+ var url = browser.runtime.getURL('/Extensions/dist/') + path;
GM_xmlhttpRequest({
method: "GET",
url: url,
```

4. Reload the XKit extension, if you have already loaded it in your browser.

2. Change the lines in xkit.js and manifest.json referenced in `dev/local-serve.patch` to point the XKit updater at `Extensions/dist`, either by hand or by running `git apply dev/local-serve.patch`:

3. Reload the XKit extension, if you have already loaded it in your browser.

After performing these steps, edits can be made to the extension files in your local development environment. Pressing "update" on the relevant entry in the "My XKit" tab of the XKit control panel and refreshing Tumblr will apply them.

Expand Down