This commit is contained in:
suti7yk5032 2024-08-15 13:25:28 +09:00
commit 2de87a862e
4 changed files with 37 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/source/logo/*

11
content.js Normal file
View file

@ -0,0 +1,11 @@
window.onload = function () {
let logo_base = document.querySelector('#logo-icon');
let logo_base2 = logo_base.querySelector('.yt-icon');
let logo_base3 = logo_base2.querySelector('.yt-spec-icon-shape');
let logo_base4 = logo_base3.querySelector('div');
let logo_base5 = logo_base4.querySelector('svg');
if (logo) {
let logo_img = chrome.runtime.getURL('source/logo/YTHUB.png');
logo_base5.outerHTML = '<img src="' + logo_img + '" width="90" height="20">'; // ここに置き換えたい画像のURLを指定してください
}
};

16
manifest.json Normal file
View file

@ -0,0 +1,16 @@
{
"manifest_version": 2,
"name": "YouTube Logo Replacer",
"version": "1.0",
"description": "Replace YouTube logo with a specified image",
"content_scripts": [
{
"matches": ["https://www.youtube.com/*"],
"js": ["content.js"]
}
],
"permissions": ["activeTab", "storage"],
"web_accessible_resources": [
"source/logo/*"
]
}

9
newFile.js Normal file
View file

@ -0,0 +1,9 @@
// content.js
window.onload = function() {
let logo = document.querySelector('.yt-icon');
if (logo) {
let logo_img = browser.runtime.getURL('source/logo/self_dlsite.png');
logo.outerHTML = '<img src="' + logo_img + '">'; // ここに置き換えたい画像のURLを指定してください
}
};