MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / getScriptPrettyUrl

Function getScriptPrettyUrl

src/common/script.js:56–68  ·  view source on GitHub ↗
(script, displayName)

Source from the content-addressed store, hash-verified

54
55/** URL that shows the name of the script and opens in devtools sources or in our editor */
56export function getScriptPrettyUrl(script, displayName) {
57 return `${
58 extensionRoot
59 }${
60 // When called from prepareScript, adding a space to group scripts in one block visually
61 displayName && IS_FIREFOX ? '%20' : ''
62 }${
63 encodeURIComponent((displayName || getScriptName(script))
64 .replace(BAD_URL_CHAR, replaceWithFullWidthForm))
65 }.user.js#${
66 script.props.id
67 }`;
68}
69
70export function getScriptsTags(scripts) {
71 // Collecting all tag arrays in a simple index

Callers 3

vacuumFunction · 0.90
testRulesFunction · 0.90
prepareScriptFunction · 0.90

Calls 1

getScriptNameFunction · 0.85

Tested by

no test coverage detected