diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2021-10-12 16:35:18 +0300 |
---|---|---|
committer | avih <avih@users.noreply.github.com> | 2021-10-19 15:43:39 +0300 |
commit | 4703b74e6c04e8e0760ad366ac0ee39576d9ff88 (patch) | |
tree | bf475df880aa60776a7abac8c4485954faadb817 /DOCS | |
parent | e13fe1299d8aefdc264e74159cce07b8bfcf722c (diff) | |
download | mpv-4703b74e6c04e8e0760ad366ac0ee39576d9ff88.tar.bz2 mpv-4703b74e6c04e8e0760ad366ac0ee39576d9ff88.tar.xz |
js: custom-init: use ~~/init.js instead of ~~/.init.js (dot)
mpv doesn't have other dot files in its config dir, and it also
shouldn't be "invisible".
The new name ~~/init.js now replaces ~~/.init.js
While mpv usually deprecates things before outright removing them,
in this case the old (dot) name is replaced without deprecation:
- It's a bad idea to execute hidden scripts, even if at a config dir,
and we don't want to do that for the next release cycle too.
- We warn if the old (dot) name exists and the new name doesn't,
which should be reasonably visible for affected users.
- It's likely niche enough to not cause too much pain.
If for some reason both names are needed, e.g. when using also an old
mpv versions, then the old name could be symlinked to the new one, or
simply have one line: `require("~~/init")` to load the new name, while
a new mpv version will load (only) the new name without warning.
Diffstat (limited to 'DOCS')
-rw-r--r-- | DOCS/interface-changes.rst | 2 | ||||
-rw-r--r-- | DOCS/man/javascript.rst | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 8cf94ceaa0..6e20fa2329 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -47,6 +47,8 @@ Interface changes bindings during start-up (default: yes). - add ``track-list/N/image`` sub-property - remove `--opengl-restrict` option + - js custom-init: use filename ~~/init.js instead of ~~/.init.js (dot) + --- mpv 0.33.0 --- - add `--d3d11-exclusive-fs` flag to enable D3D11 exclusive fullscreen mode when the player enters fullscreen. diff --git a/DOCS/man/javascript.rst b/DOCS/man/javascript.rst index 75d3033f4e..e1b93d8204 100644 --- a/DOCS/man/javascript.rst +++ b/DOCS/man/javascript.rst @@ -336,7 +336,7 @@ Custom initialization --------------------- After mpv initializes the JavaScript environment for a script but before it -loads the script - it tries to run the file ``.init.js`` at the root of the mpv +loads the script - it tries to run the file ``init.js`` at the root of the mpv configuration directory. Code at this file can update the environment further for all scripts. E.g. if it contains ``mp.module_paths.push("/foo")`` then ``require`` at all scripts will search global module id's also at ``/foo`` @@ -345,6 +345,8 @@ paths - like ``<script-dir>/modules`` for scripts which load from a directory). The custom-init file is ignored if mpv is invoked with ``--no-config``. +Before mpv 0.34, the file name was ``.init.js`` (with dot) at the same dir. + The event loop -------------- |