FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
docsify/src/plugins/external-script.js at develop · docsifyjs/docsify · GitHub
docsifyjs
docsify
Repository navigation
Code
Issues
63
(63)
Pull requests
42
(42)
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
docsify
/
src
/
plugins
/
external-script.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (23 loc) · 748 Bytes
Breadcrumbs
docsify
/
src
/
plugins
/
external-script.js
Copy path
File metadata and controls
30 lines (23 loc) · 748 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
22
23
24
25
26
27
28
29
30
const
window
=
/**
@type
{
any
} */
(
globalThis
)
;
function
handleExternalScript
(
)
{
const
container
=
Docsify
.
dom
.
getNode
(
'#main'
)
;
const
scripts
=
/**
@type
{
HTMLScriptElement[]
} */
(
Docsify
.
dom
.
findAll
(
container
,
'script'
)
)
;
for
(
const
script
of
scripts
)
{
if
(
script
.
src
)
{
const
newScript
=
document
.
createElement
(
'script'
)
;
Array
.
from
(
script
.
attributes
)
.
forEach
(
attribute
=>
{
newScript
[
attribute
.
name
]
=
attribute
.
value
;
}
)
;
script
.
before
(
newScript
)
;
script
.
remove
(
)
;
}
}
}
const
install
=
function
(
hook
)
{
hook
.
doneEach
(
handleExternalScript
)
;
}
;
window
.
$docsify
=
window
.
$docsify
||
{
}
;
window
.
$docsify
.
plugins
=
[
install
,
...
(
window
.
$docsify
.
plugins
||
[
]
)
]
;
export
{
}
;
Back
|
FazBrowse Home
|
New Git URL