Skip to content

Commit

Permalink
injectUserScript: try to decode URI
Browse files Browse the repository at this point in the history
  • Loading branch information
gdh1995 committed Nov 25, 2019
1 parent af67364 commit 7288b6b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/dom_utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,10 @@ DomUtils =

# Inject user Javascript.
injectUserScript: (text) ->
text = text[11..] if text[...11] == "javascript:"
if text[...11] == "javascript:"
text = text[11..].trim()
if text.indexOf " " < 0
try text = decodeURIComponent text
script = document.createElement "script"
script.textContent = text
document.head.appendChild script
Expand Down

0 comments on commit 7288b6b

Please sign in to comment.