mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-07-26 12:08:15 +00:00
3e2e9ed7a5
- Integrated 'Koala-Bridge' for seamless web-to-extension communication. - Implemented dedicated, minimalist invitation page (join.html). - Added brute-force protection and RAM-cleanup to the relay server. - Removed external fonts and trackers from the landing page (Privacy First). - Unified header/footer design across all website pages. - Added MIT License and comprehensive legal documentation (Impressum/Datenschutz).
32 lines
910 B
JavaScript
32 lines
910 B
JavaScript
/**
|
|
* KoalaSync Bridge Script
|
|
* Injected into koalasync.shik3i.net to facilitate communication between
|
|
* the landing page and the extension.
|
|
*/
|
|
|
|
// 1. Signal presence to the website
|
|
document.documentElement.dataset.koalasyncInstalled = 'true';
|
|
|
|
// 2. Listen for Join Requests from the Website
|
|
window.addEventListener('KOALASYNC_JOIN_REQUEST', (e) => {
|
|
const { roomId, password } = e.detail;
|
|
chrome.runtime.sendMessage({
|
|
type: 'WEB_JOIN_REQUEST',
|
|
roomId,
|
|
password
|
|
});
|
|
});
|
|
|
|
// 3. Listen for Status Updates from the Extension and relay to Website
|
|
chrome.runtime.onMessage.addListener((msg) => {
|
|
if (msg.type === 'JOIN_STATUS') {
|
|
const event = new CustomEvent('KOALASYNC_STATUS', {
|
|
detail: {
|
|
success: msg.success,
|
|
message: msg.message
|
|
}
|
|
});
|
|
window.dispatchEvent(event);
|
|
}
|
|
});
|