You can easily remove unwanted plays from your listening history
当前为
// ==UserScript==
// @name LastFM: History Cleanup
// @name:ru LastFM: Очистка истории
// @description You can easily remove unwanted plays from your listening history
// @description:ru Позволяет легко удалять нежелательные воспроизведения из истории прослушивания
// @namespace lastfm-chartlist-cleanup
// @version 0.0.1
// @license WTFPL
// @author askornot
// @match https://www.last.fm/user/*
// @grant none
// @compatible chrome Violentmonkey 2.16.0
// ==/UserScript==
!function (D, O, G, F) {
'use strict';
const clone = function (row) {
const love = row.querySelector('.chartlist-loved div');
const remove = row.querySelector('li:nth-child(7) form');
if (love === null || remove === null) return;
const a = love.cloneNode(true);
const b = remove.cloneNode(true);
b.lastElementChild.title = b.lastElementChild.textContent;
b.lastElementChild.textContent = '';
b.lastElementChild.style.background = 'transparent';
while (a.attributes.length > 0) {
a.removeAttribute(a.attributes[0].name);
}
a.replaceChild(b, a.lastElementChild);
row.insertBefore(a, row.lastElementChild);
};
!function (target, proto, prop, descriptor) {
const content = {
'text/html; charset=utf-8': function (id, fn) {
return O.assign(D.createElement('script'), {
id: id,
textContent: `document.querySelectorAll('.chartlist-row').forEach(Function('row', \`return ${fn.toString()}\`)());
document.scripts.namedItem(${id}).remove();`,
}).outerHTML;
},
};
const responseText = O[G](target[proto], prop);
O[F](target[proto], prop, {
get() {
const res = responseText[descriptor].apply(this, arguments);
if (this.readyState === target.DONE) {
const type = this.getResponseHeader('content-type');
const fn = content[type];
if (fn) {
const outer = fn(Math.random(), clone);
return res + outer;
}
}
return res;
},
});
}(XMLHttpRequest, 'prototype', 'responseText', 'get');
D.querySelectorAll('.chartlist-row').forEach(clone);
}(document, Object, 'getOwnPropertyDescriptor', 'defineProperty');
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址