4chan /gif/ sound fix - CORS issue

Fix webm that are silenced because of CORS

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         4chan /gif/ sound fix - CORS issue
// @version      0.1
// @description  Fix webm that are silenced because of CORS
// @namespace    https://greasyfork.org/users/191481
// @author       Zeper
// @match        *://*.4chan.org/gif/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=4chan.org
// @grant        unsafeWindow
// ==/UserScript==

var expandWebm_OStr = unsafeWindow.ImageExpansion.expandWebm.toString();
var regexResult = expandWebm_OStr.match(/(\w+)\.className\s*=\s*("|')expandedWebm\2([,;])/i);
eval((expandWebm_OStr.replace(regexResult[0],regexResult[1]+".crossOrigin="+regexResult[2]+"anonymous"+regexResult[2]+regexResult[3])).replace("function",'function expandWebm'));
unsafeWindow.ImageExpansion.expandWebm = expandWebm;