This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Google Chrome-Erweiterung icon.png zu einer bestehenden Website hinzufügen?
#1
Hi,
Ich wollte fragen, wie ich mein icon.png in eine bestehende Website mit Javascript einfügen kann.
Ich möchte das Twitch-Symbol auf Twitch.tv durch mein icon.png ersetzen.
Wenn das nicht funktioniert, möchte ich, dass mein icon.png neben der Suchleiste auf der rechten Seite von Twitch.tv erscheint.
Das wollte ich in eine Erweiterung einbauen, also muss es Javascript sein.

Wünsch png: https://abload.de/img/icongtebw.png

manifest.json:
{
  "manifest_version": 2,
  "name": "Compressor",
  "description": "A compressor for audio playback on Twitch.tv",
  "version": "0.1",
  "icons": {
    "48": "icon.png"
  },
  "permissions": ["activeTab"],
  "content_scripts": [
    {
      "matches": ["https://www.twitch.tv/*"],
      "js": ["compressor.js"],
      "run_at": "document_start"
    }
  ],
  "browser_action": {
    "default_icon": "icon.png"
  }
}


compressor.js
(function () {
  window.addEventListener("load", function () {
    let audioContext = new (window.AudioContext || window.webkitAudioContext)();
    let source = audioContext.createMediaElementSource(
      document.querySelector("video")
    );
    let compressor = audioContext.createDynamicsCompressor();
  
    compressor.threshold.value = -60;
    compressor.knee.value = 40;
    compressor.ratio.value = 20;
    compressor.attack.value = 0;
    compressor.release.value = 1;
  
    source.connect(compressor);
    compressor.connect(audioContext.destination);
  });
})();

Ich hoffe, jemand kann mir helfen?
Oder kennt sich jemand mit extension badge aus?

Grüße
Gehe zur Lösung Zitieren
#2
komplette Lösung:

let logodiv = document.querySelector('div.tw-animated-glitch-logo');
logodiv.innerHTML = '';
let newlogo = document.createElement("img");
newlogo.src = 'https://administrator.de/images/u/2022/11/20/4693369142_43066222500_256.jpg';
newlogo.width = 32;
newlogo.height = 32;
logodiv.appendChild(newlogo);
Zitieren
#3
Hi FrontEndler,
sorry das du keine Antwort von mir oder jemanden anderes bekommen hast. Chrome-Erweiterungen sind nicht so meine Thema und auch nicht meine Stärke. Ich finde es gut das du eine eigene Lösung gefunden hast und finde es spitze das dies auch hier postest. Denn deine Lösung ist auch bestimmt für andere User sehr hilffeich.

Viele Grüße

rzscout
FrontEndler and ollelinse like this post
"Gerne dürft ihr mir eine gute Bewertung da lassen aber auch gegenüber Kritik bin ich offen" Angel
Zitieren


Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste