Skip to content

Commit

Permalink
Add feature syncing user scripts with local files via WebDAV server
Browse files Browse the repository at this point in the history
to be able to use external editor.

Resolves greasemonkey#2513 , resolves greasemonkey#3048 , resolves greasemonkey#2666 , resolves greasemonkey#2710 , resolves greasemonkey#2738 , resolves greasemonkey#2737 , resolves greasemonkey#2736 , resolves greasemonkey#2735 , resolves greasemonkey#3098 , and resolves part of greasemonkey#2669 and greasemonkey#3115 .
  • Loading branch information
esperecyan committed May 26, 2022
1 parent 3707eb4 commit 64a2398
Show file tree
Hide file tree
Showing 16 changed files with 1,634 additions and 8 deletions.
15 changes: 15 additions & 0 deletions _locales/en/messages.json
Expand Up @@ -285,5 +285,20 @@
},
"use_enhanced_editor_explain": {
"message": "Screen reader users should disable this, as the enhanced code editor is not accessible."
},
"sync_via_webdav": {
"message": "Sync Local Files via WebDAV"
},
"sync_via_webdav_is_enabled": {
"message": "Sync Enabled"
},
"sync_via_webdav_is_disabled": {
"message": "Sync Disabled"
},
"sync_via_webdav_url": {
"message": "WebDAV Directory URL"
},
"sync_via_webdav_url_pattern_description": {
"message": "Enter a URL that begins with \"http://localhost\", contains a non-empty path, and ends with \"/\"."
}
}
23 changes: 23 additions & 0 deletions doc/Messages.md
Expand Up @@ -168,6 +168,29 @@ Request data:

* `excludes` A string, one `@exclude` pattern per line.

# SyncViaWebdavChangeOption
Sent by: `browser/monkey-menu.js`
Received by: `bg/sync-via-webdav.js`

Triggered when "Sync via WebDAV" options on the popup menu is changed by the user.
Enables, Disabled, or Reenables the sync.

Data:

Either of the following

* `enabled` boolean, the new status (true = enabled, false = disabled).
* `url` string, WebDAV directory URL.

If neither is specified, just gets "Sync via WebDAV" options.

Response data:

Ppresented upon async completion.

* `enabled` boolean, the new status (true = enabled, false = disabled).
* `url` string, WebDAV directory URL.

# UserScriptGet
Sent by: `content/edit-user-script.js`

Expand Down
1 change: 1 addition & 0 deletions karma.conf.js
Expand Up @@ -6,6 +6,7 @@ module.exports = function(config) {
'./third-party/convert2RegExp.js',
'./third-party/MatchPattern.js',
'./third-party/jszip/jszip.min.js',
'./third-party/webdav.es',
'./src/**/*.js',
'./test/**/*.test.js',
{'pattern': './skin/**', 'included': false, 'served': true},
Expand Down
3 changes: 3 additions & 0 deletions manifest.json
Expand Up @@ -38,6 +38,7 @@
"/src/bg/on-user-script-open-in-tab.js",
"/src/bg/on-user-script-xhr.js",
"/src/bg/options.js",
"/src/bg/sync-via-webdav.js",
"/src/bg/user-script-detect.js",
"/src/bg/user-script-registry.js",
"/src/bg/updater.js",
Expand All @@ -56,8 +57,10 @@
"/third-party/MatchPattern.js",
"/third-party/compare-versions/index.js",
"/third-party/jszip/jszip.min.js",
"/third-party/webdav.es",

"/src/bg/execute.run.js",
"/src/bg/sync-via-webdav.run.js",
"/src/bg/user-script-detect.run.js",
"/src/bg/user-script-registry.run.js"
]
Expand Down
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -2,7 +2,7 @@
"name": "Greasemonkey",
"version": "0.0.1",
"scripts": {
"test": "karma start karma.conf.js"
"test": "node test/test.js"
},
"devDependencies": {
"chai": "^4.1.2",
Expand All @@ -16,6 +16,7 @@
"mocha": "^3.1.2",
"sinon": "^4.1.5",
"sinon-chrome": "^2.2.1",
"tinybind": "^0.11.0"
"tinybind": "^0.11.0",
"webdav-server": "^2.3.13"
}
}

0 comments on commit 64a2398

Please sign in to comment.