pixeltris / TwitchAdSolutions

7.86k stars 450 forks source link

Please Exclude the clips page. #121

Open TsukiZero opened 1 year ago

TsukiZero commented 1 year ago

It seems to add unnecessary load padding to it when trying to make clips and sometimes doesn't make the clip snipping work as it should.

Also refer to this: https://github.com/Tampermonkey/tampermonkey/issues/1667

pixeltris commented 1 year ago

PRs are welcome. It's unlikely I'll ever look at this as I don't have an account.

TsukiZero commented 1 year ago

what I meant is basically add @exclude *://clips.twitch.tv/* and @noframes to the script. It's all

pixeltris commented 1 year ago

I'm not so sure about adding @noframes as if I'm understanding it that would make the script no longer functional on sites which embed the player.

TsukiZero commented 1 year ago

If I had a site to test that, I would...

OK, it's as you say, Embeds will not work with it...

TsukiZero commented 1 year ago

As is, the script sometimes breaks clips creation (causes the clip creation page's player to refresh, and in turn the trimmer doesn't work as intended and only the initial trim setup is used behind the scenes), and also runs multiple times per page (3 times), delaying things some.

Perhaps it might be possible to add a check for the page and iframes involved to see if it needs to run in those pages or frames. If JS were as simple as Action Script...

EDIT: Seems the solution is actually simpler for most things:

// @exclude      *://clips.twitch.tv/*
// @exclude      *://passport.twitch.tv/*
// @exclude      *://gql.twitch.tv/*
// @exclude      *://*.twitch.tv/p/ffz_bridge/

The last item is because this is a thing exclusive to Clips page and its interaction with FFZ (which, surprise surprise, happens in an iframe).

So doing this prevents the script from running on the Clips page entirely.

Another possibility (didn't test this one) is change @match to:

// @match        *://www.twitch.tv/*
// @match        *://player.twitch.tv/*