<commit_before>if (typeof com == "undefined") {
  var com = {};
}

com.sppad = com.sppad || {};
com.sppad.BeQuiet = com.sppad.BeQuiet || {};

com.sppad.BeQuiet.LastFM = function(aBrowser) {
	
	const PAUSED_CLASS = /paused/;
	
	let self = this;
	
	this.isPlaying = function() {
		if(!self.initialized)
			return false;
		
		let value = self.webRadio.getAttribute('class');
		return !PAUSED_CLASS.test(value);
	};
	
	this.play = function() {
		if(!self.initialized)
			return;
		
		self.playButton.click();
	};
	
	this.pause = function() {
		if(!self.initialized)
			return;
		
		self.pauseButton.click();
	};
	
	this.playObserver = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            if(mutation.attributeName != 'class')
            	return;
        	
            window.setTimeout(function() {
            	if(self.isPlaying())
            		self.onPlay();
            	else
                	self.onPause();
            }, 1);
        });   
    });
	<commit_msg>Changed last.fm handler to use class list instead of regex<commit_after>if (typeof com == "undefined") {
  var com = {};
}

com.sppad = com.sppad || {};
com.sppad.BeQuiet = com.sppad.BeQuiet || {};

com.sppad.BeQuiet.LastFM = function(aBrowser) {
	
	const PAUSED_CLASS = 'paused';
	
	let self = this;
	
	this.isPlaying = function() {
		if(!self.initialized)
			return false;
		
		return !self.webRadio.classList.contains(PAUSED_CLASS);
	};
	
	this.play = function() {
		if(!self.initialized)
			return;
		
		self.playButton.click();
	};
	
	this.pause = function() {
		if(!self.initialized)
			return;
		
		self.pauseButton.click();
	};
	
	this.playObserver = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            if(mutation.attributeName != 'class')
            	return;
        	
            window.setTimeout(function() {
            	if(self.isPlaying())
            		self.onPlay();
            	else
                	self.onPause();
            }, 1);
        });   
    });
	
{'fraction_non_alphanumeric': 0.14628180039138944, 'fraction_numerical': 0.0009784735812133072, 'mean_word_length': 2.2615629984051036, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4487227', 'n_tokens_mistral': 737, 'n_tokens_neox': 668, 'n_words': 108}