mirror of
https://github.com/imgfloat/client.git
synced 2026-02-05 12:09:27 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2de091567c | |||
| dc19fb7c14 | |||
| 941ac7ee19 | |||
| 38aa8acf03 | |||
| 516f991ae8 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "imgfloat-client",
|
"name": "imgfloat-client",
|
||||||
"version": "1.0.2",
|
"version": "1.0.5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "imgfloat-client",
|
"name": "imgfloat-client",
|
||||||
"version": "1.0.2",
|
"version": "1.0.5",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"electron-updater": "^6.7.3"
|
"electron-updater": "^6.7.3"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "imgfloat-client",
|
"name": "imgfloat-client",
|
||||||
"version": "1.0.3",
|
"version": "1.0.5",
|
||||||
"description": "Electron wrapper for the Imgfloat overlay",
|
"description": "Electron wrapper for the Imgfloat overlay",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"build": {
|
"build": {
|
||||||
|
|||||||
@@ -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 {
|
:root {
|
||||||
--window-frame-height: 36px;
|
--window-frame-height: 36px;
|
||||||
|
--window-control-size: 28px;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
@@ -64,15 +65,17 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.window-control {
|
.window-control {
|
||||||
width: 30px;
|
width: var(--window-control-size);
|
||||||
height: 24px;
|
height: var(--window-control-size);
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: rgba(148, 163, 184, 0.2);
|
background: rgba(148, 163, 184, 0.2);
|
||||||
border: 1px solid rgba(148, 163, 184, 0.25);
|
border: 1px solid rgba(148, 163, 184, 0.25);
|
||||||
color: #e2e8f0;
|
color: #e2e8f0;
|
||||||
font-size: 16px;
|
font-size: 14px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,9 @@
|
|||||||
<button class="window-control" type="button" data-window-action="minimize" aria-label="Minimize">
|
<button class="window-control" type="button" data-window-action="minimize" aria-label="Minimize">
|
||||||
−
|
−
|
||||||
</button>
|
</button>
|
||||||
|
<button class="window-control" type="button" data-window-action="devtools" aria-label="Toggle dev tools">
|
||||||
|
⚙
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
class="window-control window-control-close"
|
class="window-control window-control-close"
|
||||||
type="button"
|
type="button"
|
||||||
@@ -113,6 +116,9 @@
|
|||||||
if (action === "minimize") {
|
if (action === "minimize") {
|
||||||
window.store.minimizeWindow();
|
window.store.minimizeWindow();
|
||||||
}
|
}
|
||||||
|
if (action === "devtools") {
|
||||||
|
window.store.toggleDevTools();
|
||||||
|
}
|
||||||
if (action === "close") {
|
if (action === "close") {
|
||||||
window.store.closeWindow();
|
window.store.closeWindow();
|
||||||
}
|
}
|
||||||
|
|||||||
14
src/main.js
14
src/main.js
@@ -8,7 +8,7 @@ const STORE_PATH = path.join(app.getPath("userData"), "settings.json");
|
|||||||
const INITIAL_WINDOW_WIDTH_PX = 960;
|
const INITIAL_WINDOW_WIDTH_PX = 960;
|
||||||
const INITIAL_WINDOW_HEIGHT_PX = 640;
|
const INITIAL_WINDOW_HEIGHT_PX = 640;
|
||||||
const LOCAL_DOMAIN = "http://localhost:8080";
|
const LOCAL_DOMAIN = "http://localhost:8080";
|
||||||
const DEFAULT_DOMAIN = "https://imgfloat.kruhlmann.dev";
|
const DEFAULT_DOMAIN = "https://imgflo.at";
|
||||||
const RUNTIME_DOMAIN = resolveDefaultDomain();
|
const RUNTIME_DOMAIN = resolveDefaultDomain();
|
||||||
let ELECTRON_WINDOW;
|
let ELECTRON_WINDOW;
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ function createWindowOptions() {
|
|||||||
frame: false,
|
frame: false,
|
||||||
backgroundColor: "#00000000",
|
backgroundColor: "#00000000",
|
||||||
alwaysOnTop: false,
|
alwaysOnTop: false,
|
||||||
icon: path.join(__dirname, "../res/icon/appicon.ico"),
|
icon: path.join(__dirname, "../res/icon/brand.png"),
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
backgroundThrottling: false,
|
backgroundThrottling: false,
|
||||||
preload: path.join(__dirname, "preload.js"),
|
preload: path.join(__dirname, "preload.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) => {
|
ipcMain.handle("save-broadcaster", (_, broadcaster) => {
|
||||||
const store = readStore(STORE_PATH);
|
const store = readStore(STORE_PATH);
|
||||||
store.lastBroadcaster = broadcaster;
|
store.lastBroadcaster = broadcaster;
|
||||||
|
|||||||
@@ -9,4 +9,5 @@ contextBridge.exposeInMainWorld("store", {
|
|||||||
setWindowSize: (width, height) => ipcRenderer.invoke("set-window-size", width, height),
|
setWindowSize: (width, height) => ipcRenderer.invoke("set-window-size", width, height),
|
||||||
minimizeWindow: () => ipcRenderer.invoke("minimize-window"),
|
minimizeWindow: () => ipcRenderer.invoke("minimize-window"),
|
||||||
closeWindow: () => ipcRenderer.invoke("close-window"),
|
closeWindow: () => ipcRenderer.invoke("close-window"),
|
||||||
|
toggleDevTools: () => ipcRenderer.invoke("toggle-devtools"),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user