Skip to content

Commit

Permalink
Oneechan is fren (3.5.3)
Browse files Browse the repository at this point in the history
Make it so that if no custom theme is set in the player and you use oneechan, the theme will be recognized eventually (probably, might need testing on slower internet speeds/devices)
  • Loading branch information
vampiricwulf committed Apr 8, 2024
1 parent 2211e72 commit ac09b45
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/4chan-sounds-player.meta.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan sounds player
// @version 3.5.2
// @version 3.5.3
// @namespace rccom
// @description A player designed for 4chan sounds threads.
// @author RCC
Expand Down
4 changes: 2 additions & 2 deletions dist/4chan-sounds-player.user.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "4chan-sounds-player",
"version": "3.5.2",
"version": "3.5.3",
"description": "Play that faggy music weeb boi",
"main": "main.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ window.ns = 'fcsp';

window.is4chan = location.hostname.includes('4chan.org') || location.hostname.includes('4channel.org');
window.isChanX = document.documentElement && document.documentElement.classList.contains('fourchan-x');
window.isOneechan = document.documentElement && document.documentElement.classList.contains('oneechan');
window.Board = location.pathname.split('/')[1];
window.Thread = (location.href.match(/\/thread\/(\d+)/) || [])[1];

Expand Down
12 changes: 12 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ async function doInit() {
childList: true,
subtree: true
});

if (isOneechan) {
waitingForOneechan();
}
}

function waitingForOneechan () {
if(!document.querySelector('#OneeChanLink')) {
window.setTimeout(waitingForOneechan,50);
} else {
Player.theme.applyBoardTheme();
}
}

document.addEventListener('4chanXInitFinished', doInit);
Expand Down

0 comments on commit ac09b45

Please sign in to comment.