MeWe Extention

add download button to audio's

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         MeWe Extention
// @namespace    https://mewe.com/i/sajad
// @version      0.11
// @description  add download button to audio's
// @match        https://mewe.com/*
// @match        https://www.mewe.com/*
// @match        https://mewe.com/i/*
// @match        https://www.mewe.com/i/*
// @author       Sajad
// @grant        none
// @run-at      document-idle
// ==/UserScript==

window.readyHandlers = [];
window.ready = function ready(handler) {
  window.readyHandlers.push(handler);
  handleState();
};

function handleState () {
  if (['interactive', 'complete'].indexOf(document.readyState) > -1) {
    while(window.readyHandlers.length > 0) {
      (window.readyHandlers.shift())();
    }
  }
}

document.onreadystatechange = window.handleState;

document.onreadystatechange = function () {
  var state = document.readyState;
  if (state == 'interactive') {

  } else if (state == 'complete') {
      setInterval(function(){ display(); }, 500);
  }
};


function display(){
  var audios = document.querySelectorAll('.audio_wrapper');
  audios.forEach(function(item){
    var pros=item.dataset.pros;
    if (pros==='done'){}
    else{
      var mp3_link = item.querySelector('audio').src;
      var elaudio= item.querySelector('audio');
      var down_but = '<a id="DBTN" download type="application/octet-stream" target="_blank" href="${mp3_link}" style= "font-weight: bold;border: 2px solid #469dc4;border-radius: 25%;left: 5px;color: #469dc4;-webkit-text-stroke-width: 2px;width: 15px;padding-top: 0px;padding-bottom: 0px;padding-left: 4px;padding-right: 4px;">⬇</a>';
      elaudio.insertAdjacentHTML('beforebegin', down_but);
    	item.dataset.pros = "done";
    }
  });
}