SecurityError when requesting access to MIDI #195

Open
opened 2020-02-07 03:41:39 -06:00 by ArTiSTiX · 12 comments
ArTiSTiX commented 2020-02-07 03:41:39 -06:00 (Migrated from github.com)

I was working for the past few days on a Piano display (you can see it here: https://chord-display.rednet.io), using BrowserSource on OBS v21, using MIDI features of CEF.
Everything was working fine, but not anymore after update to OBS v24.
It is also working on v23 (made the downgrade).

Current Behavior

MIDI Access request rejects with following error:

SecurityError: an attempt was made to break through the security policy of the user agent

It was working fine, on a localhost version, a localfile, and on a deployed version of my tool with an HTTPS certificate.

Expected Behavior

It should allow using MIDI, and display notes played by user in OBS.

Steps to Reproduce

  1. Create a BrowserSource in OBS with url: https://chord-display.rednet.io
  2. (optional) Plug a MIDI device (piano), or install a Virtual MIDI device (OSX: MidiKeys is a good one for testing: http://www.manyetas.com/creed/midikeys.html)
  3. Play notes

Step 1 is currently breaking with error, since MIDI is initialized on load.

Additional information

OS: MacOS Mojave 10.14.6
OBS Studio version: v24.0.6
[obs-browser]: Version 2.7.16

Working OBS Studio versions: v21...v23 ([obs-browser]: Version 2.3.1)

<!--- The OBS Studio GitHub issue tracker is **ONLY** to be used for reporting bugs that have replication steps. New features should be discussed on our Discord (https://obsproject.com/discord/) or Ideas page (https://ideas.obsproject.com/). For support issues, use the Discord or forums (https://obsproject.com/forum/) --> I was working for the past few days on a Piano display (you can see it here: https://chord-display.rednet.io), using BrowserSource on OBS v21, using MIDI features of CEF. Everything was working fine, but not anymore after update to OBS v24. It is also working on v23 (made the downgrade). ## Current Behavior MIDI Access request rejects with following error: ``` SecurityError: an attempt was made to break through the security policy of the user agent ``` It was working fine, on a localhost version, a localfile, and on a deployed version of my tool with an HTTPS certificate. ## Expected Behavior It should allow using MIDI, and display notes played by user in OBS. ## Steps to Reproduce 1. Create a BrowserSource in OBS with url: https://chord-display.rednet.io 2. (optional) Plug a MIDI device (piano), or install a Virtual MIDI device (OSX: MidiKeys is a good one for testing: http://www.manyetas.com/creed/midikeys.html) 3. Play notes Step 1 is currently breaking with error, since MIDI is initialized on load. ## Additional information OS: MacOS Mojave 10.14.6 OBS Studio version: v24.0.6 [obs-browser]: Version 2.7.16 Working OBS Studio versions: v21...v23 ([obs-browser]: Version 2.3.1)
VodBox commented 2020-02-07 14:51:56 -06:00 (Migrated from github.com)

The cause of the change is related to the CEF version. Builds I had made with older versions had WebMIDI working, but newer versions (particularly the one we use in v24, maybe even v23 on Windows?) stopped working. I was unable to determine the security policy that the error message refers to. I will however be looking closer into this.

The cause of the change is related to the CEF version. Builds I had made with older versions had WebMIDI working, but newer versions (particularly the one we use in v24, maybe even v23 on Windows?) stopped working. I was unable to determine the security policy that the error message refers to. I will however be looking closer into this.
ArTiSTiX commented 2020-02-07 14:55:20 -06:00 (Migrated from github.com)

@VodBox thanks for investigating ! I was hoping it was only related to obs-browser, it would have been easier to fix I think.

@VodBox thanks for investigating ! I was hoping it was only related to obs-browser, it would have been easier to fix I think.
ArTiSTiX commented 2020-04-27 08:53:45 -05:00 (Migrated from github.com)

Hi @VodBox Any update on CEF security implementation of MIDI ?
I tried to find a ticket on CEF bugtracker without success, is there anything i can help with ?

MIDI is still not working on OBS v25 though.

Hi @VodBox Any update on CEF security implementation of MIDI ? I tried to find a ticket on CEF bugtracker without success, is there anything i can help with ? MIDI is still not working on OBS v25 though.
Kruiser8 commented 2020-05-31 21:47:14 -05:00 (Migrated from github.com)

I also just ran into this last week. I'll add that it's easily testable by opening https://francoisgeorgy.github.io/web-midi-events/webmidi-events.html in a browser source.

Additionally, I was unable to make it work by setting chromium flags. I tried --disable-web-security as well as a handful of others.

Organizing information from a discord conversation.
It looks like MIDI isn't supported in CEF at the moment. Here's the CEF ticket: https://bitbucket.org/chromiumembedded/cef/issues/1028/cef3-implement-web-midi-permission
Here's a forum post where the author of CEF says it isn't supported: https://www.magpcss.org/ceforum/viewtopic.php?f=6&t=16752

We also couldn't find any reference to MIDI libraries or functions in CEF so perhaps it was removed since it wasn't properly checking permissions (WizardCM idea)? There's no reference to midi in the git log for CEF.

I also just ran into this last week. I'll add that it's easily testable by opening https://francoisgeorgy.github.io/web-midi-events/webmidi-events.html in a browser source. Additionally, I was unable to make it work by setting chromium flags. I tried `--disable-web-security` as well as a handful of others. **Organizing information from a discord conversation.** It looks like MIDI isn't supported in CEF at the moment. Here's the CEF ticket: https://bitbucket.org/chromiumembedded/cef/issues/1028/cef3-implement-web-midi-permission Here's a forum post where the author of CEF says it isn't supported: https://www.magpcss.org/ceforum/viewtopic.php?f=6&t=16752 We also couldn't find any reference to MIDI libraries or functions in CEF so perhaps it was removed since it wasn't properly checking permissions (WizardCM idea)? There's no reference to midi in the git log for CEF.
ThePianoGuy commented 2023-04-07 18:44:58 -05:00 (Migrated from github.com)

From https://github.com/chromiumembedded/cef/issues/1028

"The CefBrowserContext::RequestMIDISysExPermission() method must be implemented to allow Web MIDI usage." The issue is now closed as completed.

Does that mean we can now use MIDI in BrowserSource? If so, how?

From https://github.com/chromiumembedded/cef/issues/1028 "The CefBrowserContext::RequestMIDISysExPermission() method must be implemented to allow Web MIDI usage." The issue is now closed as completed. Does that mean we can now use MIDI in BrowserSource? If so, how?
CodexHere commented 2023-06-29 16:48:16 -05:00 (Migrated from github.com)

Just ran into this as well, any chance of a status update or any feedback?

Just ran into this as well, any chance of a status update or any feedback?
swolekat commented 2023-08-29 11:57:07 -05:00 (Migrated from github.com)

Any update on this issue for the latest version? I was trying to implement something like this today but ran into this issue.

Any update on this issue for the latest version? I was trying to implement something like this today but ran into this issue.
kirahan commented 2023-09-13 20:12:34 -05:00 (Migrated from github.com)

Marked, and let me know if any update or feedback

Marked, and let me know if any update or feedback
swolekat commented 2023-11-11 21:47:31 -06:00 (Migrated from github.com)

This is still an issue in OBS 30.0

This is still an issue in OBS 30.0
nzoschke commented 2023-12-02 19:25:24 -06:00 (Migrated from github.com)

Hitting this here too. Also tried running the web server serving the web midi page on https://127.0.0.1:4321/ with a valid cert via mkcert.

Hitting this here too. Also tried running the web server serving the web midi page on `https://127.0.0.1:4321/` with a valid cert via `mkcert`.
Fenrirthviti commented 2023-12-02 21:27:04 -06:00 (Migrated from github.com)

I'm reasonably sure that this would need to be backported manually to the version of CEF we use, and it is not likely that anyone on the core team would be spending time on this any time soon.

I'm reasonably sure that this would need to be backported manually to the version of CEF we use, and it is not likely that anyone on the core team would be spending time on this any time soon.
ThePianoGuy commented 2023-12-03 14:07:25 -06:00 (Migrated from github.com)

Boys, we have to learn to manually backport this to CEF.

Boys, we have to learn to manually backport this to CEF.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-obsproject/obs-browser#195
No description provided.