From 2de87a862eb53a914e7cc86bf965368b2105e7c2 Mon Sep 17 00:00:00 2001 From: suti7yk5032 Date: Thu, 15 Aug 2024 13:25:28 +0900 Subject: [PATCH] 1st --- .gitignore | 1 + content.js | 11 +++++++++++ manifest.json | 16 ++++++++++++++++ newFile.js | 9 +++++++++ 4 files changed, 37 insertions(+) create mode 100644 .gitignore create mode 100644 content.js create mode 100644 manifest.json create mode 100644 newFile.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cfc9980 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/source/logo/* diff --git a/content.js b/content.js new file mode 100644 index 0000000..8d758e4 --- /dev/null +++ b/content.js @@ -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 = ''; // ここに置き換えたい画像のURLを指定してください + } +}; diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..d60757c --- /dev/null +++ b/manifest.json @@ -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/*" + ] +} \ No newline at end of file diff --git a/newFile.js b/newFile.js new file mode 100644 index 0000000..0cdea2a --- /dev/null +++ b/newFile.js @@ -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 = ''; // ここに置き換えたい画像のURLを指定してください + } + }; + \ No newline at end of file