Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions browser-addons/manifest-firefox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"manifest_version": 3,
"name": "Funix Extension",
"description": "FunixGaming Addon pour ne rien louper ! Lives, vidéos et autres !",
"version": "2.0.0",
"author": "[email protected]",
"homepage_url": "https://funixgaming.fr",

"permissions": ["notifications"],

"action": {
"default_title": "Funix Addon",
"default_popup": "src/html/base.html",
"default_icon": "src/icons/app_icon.png"
},

"icons": {
"64": "src/icons/app_icon.png"
},

"background": {
"scripts": ["src/js/background.js"]
}
}

48 changes: 26 additions & 22 deletions browser-addons/manifest.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
{
"manifest_version": 3,
"name": "Funix Extension",
"description": "FunixGaming Addon pour ne rien louper ! Lives, vidéos et autres !",
"version": "2.0.0",
"author": "[email protected]",
"homepage_url": "https://funixgaming.fr",

"permissions": ["notifications"],

"action": {
"default_title": "Funix Addon",
"default_popup": "src/html/base.html",
"default_icon": "src/icons/app_icon.png"
},

"icons": {
"64": "src/icons/app_icon.png"
},

"background": {
"service_worker": "src/js/background-chrome.js"
"manifest_version": 3,
"name": "Funix Extension",
"description": "FunixGaming Addon pour ne rien louper ! Lives, vidéos et autres !",
"version": "2.0.0",
"author": "[email protected]",
"homepage_url": "https://funixgaming.fr",

"permissions": ["notifications"],

"action": {
"default_title": "Funix Addon",
"default_popup": "src/html/base.html",

"default_icon": {
"64":"src/icons/app_icon.png"
}
},

"icons": {
"64": "src/icons/app_icon.png"
},

"background": {
"service_worker": "src/js/background.js"
}
}
}
4 changes: 2 additions & 2 deletions browser-addons/src/html/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
<i class="fas fa-user"> <span id="twitch-stream-viewers">0</span></i>
</div>
<div class="col-8">
<i class="fas fa-gamepad"> <span id="twitch-game-name">Hors Lig</span></i>
<i class="fas fa-gamepad"> <span id="twitch-game-name">Hors Ligne</span></i>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="join-live">
<div class="join-live" id="join-live" hidden>
<a target="_blank" href="https://twitch.tv/funixgaming">
<div class="p-2">
<span>Rejoindre le live</span>
Expand Down
24 changes: 0 additions & 24 deletions browser-addons/src/js/background-chrome.js

This file was deleted.

32 changes: 32 additions & 0 deletions browser-addons/src/js/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const url = 'https://api.funixgaming.fr/twitch/streams/funix';

let body = {};

function setIcon(iconPath) {
if (navigator.userAgent.indexOf("Firefox") !== -1) {
browser.action.setIcon({
path: iconPath
});
} else if (navigator.userAgent.indexOf("Chrome") !== -1) {
chrome.action.setIcon({
path: iconPath
});
}
}

function checkStream() {
fetch(url).then(async response => {
if (response.ok) {
body = await response.json();

if (body.data.length === 0) {
setIcon("/src/icons/app_icon.png");
} else {
setIcon("/src/icons/app_icon_live.png");
}
}
});
}

checkStream();
setInterval(checkStream, 10000);
2 changes: 2 additions & 0 deletions browser-addons/src/js/twitch-handle-front.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const spanStreamTitle = document.getElementById('twitch-stream-title');
const spanTwitchViewers = document.getElementById('twitch-stream-viewers');
const spanGameName = document.getElementById('twitch-game-name');
const imgMiniaLive = document.getElementById('twitch-stream-minia');
const joinLiveBtn = document.getElementById('join-live');
const defaultMiniaLive = '../img/offline.png';
const url = 'https://api.funixgaming.fr/twitch/streams/funix';

Expand All @@ -26,6 +27,7 @@ function updateLiveHtml(live) {
setText(spanTwitchViewers, live.viewer_count.toString());
setText(spanGameName, live.game_name);
imgMiniaLive.src = live.thumbnail_url.replace("{width}", "990").replace("{height}", "540");
joinLiveBtn.hidden = false;
}

function turnOffLive() {
Expand Down