This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
class ButtonElement { | |
constructor(selector) { | |
this.selector = selector; | |
} | |
get element() { | |
return document.querySelector(this.selector); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
class MarkdownSyntax { | |
static getFootNote({ identifier, content }) { | |
return `${identifier}: ${content}`; | |
} | |
static getLink({ title, url }) { | |
return `[${title}](${url})`; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const videoDescriptionSelector = '#description-inline-expander > yt-attributed-string'; | |
const $videoDescription = document.querySelector(videoDescriptionSelector); | |
const [songTitle, artist] = $videoDescription?.textContent | |
.split('\n\n')[1] | |
.split(' · '); | |
const fullArtist = document.querySelector('#owner #upload-info a').textContent; | |
const result = `${fullArtist} - ${songTitle}`; | |
copy(result); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const redirectMatchers = [ | |
{ | |
matcher: () => location.host.includes('slideshare.net'), | |
action: redirectSlideShare | |
}, | |
{ | |
matcher: () => location.host.includes('facebook'), | |
action: redirectFacebook | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
if (location.host === 'm.facebook.com') { | |
location.href = 'https://www.facebook.com' + location.pathname + location.search; | |
return; | |
} | |
if (location.host === 'www.facebook.com') { | |
location.href = 'https://m.facebook.com' + location.pathname + location.search; | |
return; | |
} | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
class Sidebar { | |
constructor(element) { | |
this.element = element; | |
} | |
get display() { | |
return this.element.style.display; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const vedioId = location.pathname.split('/').at(-1); | |
location.href = `${location.origin}/watch?v=${vedioId}`; | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
const sidebar = document.querySelector('#sidebar'); | |
sidebar.style.display = !sidebar.style.display ? 'none' : null; | |
})() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const title = document.querySelector('[data-testid=context-item-info-title]').textContent; | |
const [...artists] = document.querySelectorAll('[data-testid=context-item-info-artist]'); | |
const artistList = artists.map(artist => artist.textContent).join(' & '); | |
const textArea = document.createElement('textarea'); | |
textArea.value = `${artistList} - ${title}`; | |
document.body.appendChild(textArea); | |
textArea.select(); | |
document.execCommand('Copy'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
if (location.hostname === 'github.com') { | |
const [_, username, repo] = location.pathname.split('/'); | |
location.href = `https://${username}.github.io/${repo}`; | |
return; | |
} | |
if (location.hostname.includes('github.io')) { | |
const username = location.host.split('.')[0]; | |
const repo = location.pathname.split('/')[1]; | |
location.href = `https://github.com/${username}/${repo}`; |
NewerOlder