mirror of
https://github.com/imgfloat/client.git
synced 2026-02-04 19:49:26 +00:00
Merge branch 'master' of github.com:imgfloat/client
This commit is contained in:
@@ -1,90 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>OBS Browser API Check</title>
|
||||
<style>
|
||||
body {
|
||||
background: #111;
|
||||
color: #eee;
|
||||
font-family: monospace;
|
||||
padding: 16px;
|
||||
}
|
||||
h1 {
|
||||
color: #6cf;
|
||||
}
|
||||
.fail {
|
||||
color: #f66;
|
||||
}
|
||||
.ok {
|
||||
color: #6f6;
|
||||
}
|
||||
pre {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>OBS Browser Source – Missing API Report</h1>
|
||||
<pre id="log"></pre>
|
||||
|
||||
<script>
|
||||
const logEl = document.getElementById("log");
|
||||
|
||||
function log(line, cls = "") {
|
||||
const span = document.createElement("div");
|
||||
if (cls) span.className = cls;
|
||||
span.textContent = line;
|
||||
logEl.appendChild(span);
|
||||
}
|
||||
|
||||
const apiChecks = {
|
||||
"window.chrome": () => window.chrome,
|
||||
"navigator.mediaDevices": () => navigator.mediaDevices,
|
||||
"navigator.mediaDevices.getUserMedia": () => navigator.mediaDevices?.getUserMedia,
|
||||
RTCPeerConnection: () => window.RTCPeerConnection,
|
||||
WebSocket: () => window.WebSocket,
|
||||
Notification: () => window.Notification,
|
||||
PaymentRequest: () => window.PaymentRequest,
|
||||
SharedArrayBuffer: () => SharedArrayBuffer,
|
||||
ServiceWorker: () => navigator.serviceWorker,
|
||||
"Clipboard API": () => navigator.clipboard,
|
||||
WebGL2: () => {
|
||||
const c = document.createElement("canvas");
|
||||
return c.getContext("webgl2");
|
||||
},
|
||||
AudioWorklet: () => window.AudioWorklet,
|
||||
"Gamepad API": () => navigator.getGamepads,
|
||||
"Screen Orientation API": () => screen.orientation,
|
||||
"Permissions API": () => navigator.permissions,
|
||||
"File System Access API": () => window.showOpenFilePicker,
|
||||
"WebRTC DataChannel": () => window.RTCPeerConnection && RTCPeerConnection.prototype.createDataChannel,
|
||||
IndexedDB: () => window.indexedDB,
|
||||
BroadcastChannel: () => window.BroadcastChannel,
|
||||
"Web MIDI": () => navigator.requestMIDIAccess,
|
||||
};
|
||||
|
||||
log("Running API availability check...\n");
|
||||
|
||||
let missing = 0;
|
||||
|
||||
for (const [name, test] of Object.entries(apiChecks)) {
|
||||
let result;
|
||||
try {
|
||||
result = test();
|
||||
} catch (e) {
|
||||
result = undefined;
|
||||
}
|
||||
|
||||
if (result === undefined || result === null) {
|
||||
log(`${name} → undefined / unavailable`, "fail");
|
||||
missing++;
|
||||
} else {
|
||||
log(`${name} → OK`, "ok");
|
||||
}
|
||||
}
|
||||
|
||||
log(`\nSummary: ${missing} APIs missing or unavailable.`);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
:root {
|
||||
--window-frame-height: 36px;
|
||||
--window-control-size: 28px;
|
||||
}
|
||||
|
||||
p {
|
||||
@@ -64,15 +65,17 @@ body {
|
||||
}
|
||||
|
||||
.window-control {
|
||||
width: 30px;
|
||||
height: 24px;
|
||||
width: var(--window-control-size);
|
||||
height: var(--window-control-size);
|
||||
padding: 0;
|
||||
border-radius: 6px;
|
||||
background: rgba(148, 163, 184, 0.2);
|
||||
border: 1px solid rgba(148, 163, 184, 0.25);
|
||||
color: #e2e8f0;
|
||||
font-size: 16px;
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
<button class="window-control" type="button" data-window-action="minimize" aria-label="Minimize">
|
||||
−
|
||||
</button>
|
||||
<button class="window-control" type="button" data-window-action="devtools" aria-label="Toggle dev tools">
|
||||
⚙
|
||||
</button>
|
||||
<button
|
||||
class="window-control window-control-close"
|
||||
type="button"
|
||||
@@ -113,6 +116,9 @@
|
||||
if (action === "minimize") {
|
||||
window.store.minimizeWindow();
|
||||
}
|
||||
if (action === "devtools") {
|
||||
window.store.toggleDevTools();
|
||||
}
|
||||
if (action === "close") {
|
||||
window.store.closeWindow();
|
||||
}
|
||||
|
||||
10
src/main.js
10
src/main.js
@@ -70,6 +70,16 @@ ipcMain.handle("close-window", () => {
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle("toggle-devtools", () => {
|
||||
if (ELECTRON_WINDOW && !ELECTRON_WINDOW.isDestroyed()) {
|
||||
if (ELECTRON_WINDOW.webContents.isDevToolsOpened()) {
|
||||
ELECTRON_WINDOW.webContents.closeDevTools();
|
||||
} else {
|
||||
ELECTRON_WINDOW.webContents.openDevTools({ mode: "detach" });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.handle("save-broadcaster", (_, broadcaster) => {
|
||||
const store = readStore(STORE_PATH);
|
||||
store.lastBroadcaster = broadcaster;
|
||||
|
||||
@@ -9,4 +9,5 @@ contextBridge.exposeInMainWorld("store", {
|
||||
setWindowSize: (width, height) => ipcRenderer.invoke("set-window-size", width, height),
|
||||
minimizeWindow: () => ipcRenderer.invoke("minimize-window"),
|
||||
closeWindow: () => ipcRenderer.invoke("close-window"),
|
||||
toggleDevTools: () => ipcRenderer.invoke("toggle-devtools"),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user