Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Is it possible to use this from userscript like Tampermonkey or anything similar? #348

Answered by Destroy666x
Destroy666x asked this question in Q&A
Discussion options

I'm wondering if there's a way to integrate this with a userscript to send data to OBS from that. 99.99% sure it's not, but worth asking, maybe someone will lead me onto the right path or another solution.

E.g. this:

// ==UserScript==
// @name Test
// @namespace http://tampermonkey.net/
// @version 2024年01月14日
// @description try to take over the world!
// @author You
// @match *://*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=npmjs.com
// @require https://cdn.jsdelivr.net/npm/obs-websocket-js
// @grant none
// ==/UserScript==
(async function() {
 'use strict';
 const obs = new OBSWebSocket();
 await obs.connect('ws://192.168.0.4:4455');
})();

results in:

Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.

Any other ideas on how to send data from userscript to OBS?

EDIT: I guess it works if you enable insecure content in Chrome at least, but is there any way to make it secure without manual tinkering with such options, which shouldn't really be enabled in the 1st place? I guess there's wss option but no clue how to enable that possibility as it doesn't work by default.

You must be logged in to vote

Ok, you just need to use tunnelling it seems: https://github.com/obsproject/obs-websocket/wiki/SSL-Tunneling Solved with ngrok.

Replies: 1 comment

Comment options

Ok, you just need to use tunnelling it seems: https://github.com/obsproject/obs-websocket/wiki/SSL-Tunneling Solved with ngrok.

You must be logged in to vote
0 replies
Answer selected by Destroy666x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /