Skip to content

Commit 9f826dc

Browse files
committed
doc: simplify/rephrase editor article
1 parent 9e3390c commit 9f826dc

5 files changed

Lines changed: 11 additions & 28 deletions

File tree

Binary file not shown.
Binary file not shown.

content/posts/how-to-edit-scripts-with-your-favorite-editor/index.md

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,26 @@ tags:
55
- editor
66
---
77

8-
Since Violentmonkey is a lightweight script manager by design, its editor is simple and offers just a few options. It doesn't try to replicate a full-featured editor or IDE, which is problematic anyway due to browser's hardcoded hotkeys and other restrictions.
8+
Since Violentmonkey is lightweight by design with a simple built-in editor featuring just a few customizations in the extension's options, we encourage you to use an external editor or IDE that's not restricted by browser quirks like the hardcoded hotkeys or performance limitations.
99

10-
<details>
11-
<summary>Screenshot of the built-in editor and its options</summary>
10+
⚡ Simply open the local `.user.js` file in Violentmonkey and enable tracking, so each time you save the file in your external editor the changes are automatically incorporated.
1211

13-
![](editor-1.png)
14-
15-
Customization in the extension's settings:
16-
17-
![](editor-2.png)
18-
19-
</details>
20-
21-
<br/>
22-
23-
Excellent external editors exist and using one to edit scripts in Violentmonkey is relatively simple, no need to reinvent the wheel.
12+
Now let's dive into the details.
2413

2514
## 1. One-time preparation
2615

2716
1. Copy the code of the script from Violentmonkey into your editor.
2817
2. Save it to a file and give it a name ending with `.user.js`
2918

30-
## 2. Open this file in Violentmonkey installer
31-
32-
⚠ The local file's name must end with `.user.js`, otherwise it won't be recognized by Violentmonkey. The only exception is method 2.1, which recognizes any `.js` file because you explicitly drag it into the extension.
33-
34-
You can use any of these methods listed in the order of increasing complexity:
35-
36-
#### 2.1. Drag the file into any Violentmonkey tab or popup
19+
## 2. Open `.user.js` file in Violentmonkey installer
3720

38-
⚠ Only implemented in Chrome/Chromium 86 or newer and Violentmonkey 2.16 or newer.
21+
#### 2.1. Drag `.user.js` file into any Violentmonkey UI page [Chrome only]
3922

40-
⚡ Chromium 133 and newer improves performance of detection via `FileSystemObserver` API. Chromium 129-132 can use it too if you go to `chrome://flags/#enable-experimental-web-platform-features` and enable this flag, then restart the browser.
23+
* Chrome [86 or newer](https://caniuse.com/mdn-api_datatransferitem_getasfilesystemhandle), Violentmonkey 2.16 or newer. This is the most performant method since Chrome 133 that implemented `FileSystemObserver` API to notify of file changes.
4124

42-
If you assigned a hotkey to activate Violentmonkey in the browser's options for extensions, you can press it while dragging the file, which opens the extension's popup into which you can drop the dragged file.
25+
* If you assign a hotkey to activate Violentmonkey in the browser's options for extensions, you can press it *while dragging the file*.
4326

44-
#### 2.2. Drag the file into the browser toolbar or tab label area
27+
#### 2.2. Drag `.user.js` file into the browser toolbar or tab label area
4528

4629
* In Chrome-like browsers you must enable *"Allow access to file URLs"* in Violentmonkey's details in `chrome://extensions` page first. Since this is dangerous (any userscript will be able to read any local file via GM_xmlhttpRequest), you may want to use the other methods instead.
4730

@@ -59,7 +42,7 @@ You can use any of these methods listed in the order of increasing complexity:
5942

6043
## 3. Enable tracking
6144

62-
![](editor-3.png)
45+
![](track.png)
6346

6447
Click `Track external edits` button to confirm installation and start tracking.
6548

@@ -71,9 +54,9 @@ As long as the installer tab is open it will track your local file and install t
7154

7255
* The `Stop tracking` button may be useful for example when temporarily switching branches in your git repo. When finished, you can click `Track external edits` again.
7356

74-
* The `Reload tab` option allows you to switch to another tab with a website [matched](/api/matching/) by this script, so that this tab will be reloaded automatically when changes are detected and this script still matches the tab's URL.
57+
* The `Reload tab` option will automatically reload the active tab if it contains a website [matched](/api/matching/) by this script when changes are detected.
7558

76-
![](editor-4.png)
59+
![](tracking.png)
7760

7861
Known issues
7962
---

content/posts/how-to-edit-scripts-with-your-favorite-editor/editor-3.png renamed to content/posts/how-to-edit-scripts-with-your-favorite-editor/track.png

File renamed without changes.

content/posts/how-to-edit-scripts-with-your-favorite-editor/editor-4.png renamed to content/posts/how-to-edit-scripts-with-your-favorite-editor/tracking.png

File renamed without changes.

0 commit comments

Comments
 (0)