document.querySelectorAll('a[href*=\\&pp\\=]').forEach(el => {el.href = decodeURIComponent("/watch?v="+el.href.match(/v=(.*?)(&|$)/)[1])})
to my userscript injected into YT. I still need to pinpoint reliable DOMSubtreeModified event to make it work without manually reloading the page.Edit: and just now discovered its being added server side. Fetched https://www.youtube.com/youtubei/v1/browse?key=xxx already has &pp=sAQA, makes patching even easier, just donna hijack fetch and strip them in the handler... aaand done:
const origFetch = unsafeWindow.fetch
unsafeWindow.fetch = async (url, init) => {
if (url.url.startsWith('https://www.youtube.com/youtubei/v1/browse?key=')) {
let response = await (await origFetch(url)).text()
response = response.replace(/(\&pp\=.*?)",/g,"\",")
return new Response(response)
}
else {
return origFetch(url)
}
}
window.addEventListener('DOMContentLoaded', ()=> {
if (document.location.pathname == "/feed/subscriptions") {
document.querySelectorAll('a[href*=\\&pp\\=]').forEach(el => {el.href = decodeURIComponent("/watch?v="+el.href.match(/v=(.*?)(&|$)/)[1])})
}
}) self.airgap = {
overrides: [{
matcher: '//www.youtube.com/',
override(request) {
request.urls.forEach((input, i) => {
const url = new URL(input, location.href);
if (url.searchParams.has('pp')) {
url.searchParams.delete('pp');
request.urls[i] = url.href;
}
});
}
}]
};>Transcend Consent Manager's API
what is that?
>request-override based approach
the idea is to modify those URLs before they get rendered on the page, this way they get applied :visited style in the first place.
A new consent management tool for website owners. We're currently in closed beta. Learn more here: https://transcend.io/blog/defeating-cookie-banners
> the idea is to modify those URLs before they get rendered on the page
These overrides are applied before the URLs are rendered on the page or trigger any requests.
Now I understand. Your product is aimed at corporations seeking more mature? compliance with privacy laws. Sounds like tough market.
I wish there were browser extensions capable to smartly sanitize the history by removing duplicate URLs pointing to the same actual page visited multiple times during the day and/or by via slightly different URLs, removing the specific parameters which can be removed without changing what does the link point to, rearranging the remaining parameters alphabetically, removing GMail and alike useless URLs, also normalizing the entry titles by removing everything but the actual article title (e.g. removing website name or moving it to an uniform place - always the beginning or always the end) etc.
The web browser is becoming just a shitty operating system, largely controlled by unaccountable megacorps who are primarily interested not in empowering users but in tracking them and serving them ads.
Perhaps if the web servers served something like QML/XAML/whatever (while other web servers serving just APIs for them to get/post the content) and there was an operating system command to run such an app by its URL, both the developers and the users might have a better experience. Or perhaps worse.
This way we might even have more than one standard competing: QML, XAML and whatever else would emerge (introducing new would be more viable) vs just HTML.
(I don't know if it's still the case, but I've heard that if you log into YouTube, and Google for some reason decides your real name is not your real name, you could lose access to your whole Google account; and at least to me, the Google Talk account was more important than being able to comment on YouTube videos.)
It will probably depend on other factors as well such as IP, country, …
// make VISITED links distinct
//subscriptions/lists
css += 'a#video-title {color: #167ac6!important;}';
css += 'a:visited#video-title {color: #141761!important;}';
//commenter channel name
css += 'a#author-text {color: #167ac6!important;}';
css += 'a:visited#author-text {color: #141761!important;}';
//sidebar
css += 'a #video-title {color: #167ac6!important;}';
css += 'a:visited #video-title {color: #141761!important;}';
css += '#content-text a, #description a {color: #167ac6!important;}';
css += '#content-text a:visited, #description a:visited{color: #141761!important;}';
makes pretty clear which links are visited