![]() ![]() |
Hi,
// ==UserScript==
// @name Grooveshark Duplicates Remover
// @namespace grooverem
// @description Removes duplicated songs from playing queue
// @include http://*grooveshark.com*
// @version 0.1
// @icon http://grooveshark.com/webincludes/images/favicon64.ico
// ==/UserScript==
function rem() {
song_hash = {};
removal_list = [];
var song;
var str;
for(var i = 0; i < window.GS.player.queue.songs.length; i++) {
song = window.GS.player.queue.songs[i];
str=song["SongName"].toLowerCase();
if(song_hash[str] == undefined) {
song_hash[str] = 1;
}
else {
removal_list.push(song["queueSongID"]);
}
}
window.GS.player.removeSongs(removal_list);
}
rem();
I appreciate any help. |
![]() ![]() |
In Greasemonkey, you can't access page JavaScript directly for security reasons. You can try to use unsafeWindow (with your code, this will allow any web page with grooveshark.com in the URL to run arbitrary JavaScript with the same privileges as Greasemonkey). You can also try to inject the script directly into the page; this might be better in your case. Try this code:
|


