Skip to content

Commit

Permalink
fix: Incomplete URL scheme check (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
legobeat authored Oct 23, 2024
1 parent d2ec81f commit 179980b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function setupOpenSelfInNewTabLink() {
*/
function isValidSuspectHref(href: string) {
/* eslint-disable-next-line */
const disallowedProtocols = ['javascript:'];
const disallowedProtocols = ['javascript:', 'data:', 'vbscript:'];
const parsedSuspectHref = new URL(href);

return disallowedProtocols.indexOf(parsedSuspectHref.protocol) < 0;
Expand Down

0 comments on commit 179980b

Please sign in to comment.