Skip to content

Commit 52b8931

Browse files
committed
fix: undefined variable
1 parent 3dc32aa commit 52b8931

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
# dmliver-extension
22

3-
>Play video/live streaming from Bilibili, Youtube, etc. to DMLive, use with dmlive and vimium-c (a vim-based chromium extension)
3+
>Play video/live streaming from Bilibili, Youtube, etc. to DMLive, use with dmlive and vimium-c (a vim-like chromium extension)
4+
5+
you can get the extension from [release](https://github.com/liuhq/dmliver-extension/releases), unpack and install to chrome.
46

57
## Usage
68

7-
Go to [chrome://extensions/shortcuts](chrome://extensions/shortcuts), bind a keyboard shortcut to dmliver, like `Ctrl-Shift-P` (will override "print page")
9+
Go to `chrome://extensions/shortcuts`, bind a keyboard shortcut to dmliver, like `Ctrl-Shift-P` (will override "print page").
810

911
via vimium-c commands:
1012

1113
- `yy`: copy the current tab's url
1214
- `yf`: copy the hint link
1315

14-
then trigger the shortcut key to run dmlive and play in mpv
16+
then trigger the shortcut key to run dmlive and play in mpv.
1517

16-
>Note: this extension will read the first item in your clipboard to get the video url
18+
>Note: this extension will read the first item in your clipboard to get the video url.
1719
1820
## MIME Register
1921

22+
create `dmlive.desktop`
23+
2024
```ini
2125
[Desktop Entry]
2226
Version=1.0
@@ -29,12 +33,16 @@ Exec=<your_path_to>/dmlive --quiet --url %u
2933
MimeType=x-scheme-handler/dmlive;
3034
```
3135

36+
move it to `~/.local/share/applications/`
37+
38+
run `update-desktop-database -v ~/.local/share/applications` to update mime cache.
39+
3240
## Thanks
3341

3442
- [dmlive](https://github.com/THMonster/dmlive)
3543
- [vimium-c](https://github.com/gdh1995/vimium-c)
3644

37-
the extension icon from [revda.png](https://github.com/THMonster/Revda/blob/master/misc/browser-extension/icons/revda.png)
45+
the extension icon from [revda.png](https://github.com/THMonster/Revda/blob/master/misc/browser-extension/icons/revda.png).
3846

3947
## License
4048

extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 3,
33
"name": "DMLiver",
44
"description": "Open video/live from bilibili/Youtube, etc. with DMLive",
5-
"version": "0.1.0",
5+
"version": "0.1.1",
66
"author": {
77
"name": "Horace Liu",
88
"url": "https://github.com/liuhq",

extension/scripts/content.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ function parseUrl(raw) {
4141
const dmliveProtocol = 'dmlive://' + dmliveParsed.hostname + dmliveParsed.pathname
4242

4343
switch (true) {
44-
case url.includes('bilibili.com'):
44+
case raw.includes('bilibili.com'):
4545
return dmliveProtocol
4646
+ (dmliveParsed.searchParams.get('p')
4747
? '?p=' + dmliveParsed.searchParams.get('p')
4848
: '')
49-
case url.includes('youtube.com/watch'):
49+
case raw.includes('youtube.com/watch'):
5050
return dmliveProtocol
5151
+ (dmliveParsed.searchParams.get('v')
5252
? '?v=' + dmliveParsed.searchParams.get('v')

0 commit comments

Comments
 (0)