Skip to content

Commit 2653849

Browse files
committed
fix(external-script): script attrs
1 parent d7b0d1b commit 2653849

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plugins/external-script.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ function handleExternalScript () {
88
if (script && script.src) {
99
const newScript = document.createElement('script')
1010

11-
;['src', 'async', 'defer'].forEach(attribute => {
12-
newScript[attribute] = script[attribute]
11+
Array.prototype.slice.call(script.attributes).forEach(attribute => {
12+
newScript[attribute.name] = attribute.value
1313
})
1414

1515
script.parentNode.insertBefore(newScript, script)

0 commit comments

Comments
 (0)