Sleazy Fork is available in English.

Συζητήσεις » Ανάπτυξη

possible to combine two userscripts that operate in the same domain, but different match?

§
Δημοσιεύτηκε: 08/11/2019

possible to combine two userscripts that operate in the same domain, but different match?

Is it possible to consolidate two or more scripts into one? I'd like to make it easier for people to enable a collection of "features" without having a ton of scripts to maintain.

example: One script operations on www.domain.com/pageA/* the other on www.domain.com/pageB/*

wOxxOmΣυντονιστής
§
Δημοσιεύτηκε: 08/11/2019

Combine @match or @include from both scripts and check location:

if (location.pathname.startsWith('/pageA')) {
  console.log('a');
} else {
  console.log('b');
}

Δημοσίευση απάντησης

Συνδεθείτε για να δημοσιεύσετε μια απάντηση.