MeWe Extention

add download button to audio's

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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";
    }
  });
}