MCPcopy Index your code
hub / github.com/violentmonkey/violentmonkey / inferScriptSupportUrl

Function inferScriptSupportUrl

src/background/utils/script.js:234–246  ·  view source on GitHub ↗

* @param {VMScript} script * @param {string} [home] * @returns {string | undefined}

(script, home = getScriptHome(script))

Source from the content-addressed store, hash-verified

232 * @returns {string | undefined}
233 */
234function inferScriptSupportUrl(script, home = getScriptHome(script)) {
235 let u = home && home.match(re`/
236 ^https:\/\/(?:
237 (?:
238 (greas|sleaz)yfork\.(?:org|cc)(?:\/(?!scripts)[^/]+)? |
239 openuserjs\.org
240 )(?=\/scripts\/) |
241 github\.com
242 )\/[^/]+\/[^/]+/x`);
243 if (u) {
244 return `${u[0]}/${u[1] ? 'feedback' : 'issues'}`;
245 }
246}
247
248/** @param {VMScript} script */
249export function inferScriptProps(script) {

Callers 1

inferScriptPropsFunction · 0.85

Calls 1

getScriptHomeFunction · 0.90

Tested by

no test coverage detected