FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
plugin-userscript/src/index.js at main · iina/plugin-userscript · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
iina
/
plugin-userscript
Public
Notifications
You must be signed in to change notification settings
Fork
7
Star
60
Code
Issues
3
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
plugin-userscript
/
src
/
index.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (17 loc) · 540 Bytes
Breadcrumbs
plugin-userscript
/
src
/
index.js
Copy path
File metadata and controls
21 lines (17 loc) · 540 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import
{
loadUserScripts
}
from
"./utils"
;
const
scripts
=
loadUserScripts
(
)
;
iina
.
console
.
log
(
scripts
)
;
for
(
const
{
id
,
name
}
of
scripts
)
{
iina
.
console
.
log
(
`Running script "
${
name
}
", id=
${
id
}
`
)
;
const
path
=
`@data/
${
id
}
.js`
;
if
(
!
iina
.
file
.
exists
(
path
)
)
{
console
.
log
(
`File
${
path
}
doesn't exist; skipped.`
)
;
}
const
content
=
iina
.
file
.
read
(
path
)
;
try
{
const
func
=
new
Function
(
"iina"
,
content
)
;
func
(
iina
)
;
}
catch
(
e
)
{
iina
.
console
.
error
(
`Error running script "
${
name
}
", id=
${
id
}
:
${
e
}
`
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL