Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #35748
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2018-10-07 23:13 -0700 |
| References | <6a7727a4-fc96-4366-94aa-4f2b502b64a4@googlegroups.com> <17wmx6hu6z8kn.lq8ggse14t2a$.dlg@40tude.net> |
| Message-ID | <8a52ba75-e3b3-4fd3-828c-6530b945096b@googlegroups.com> (permalink) |
| Subject | Re: Catching event from message alert box, and wait until resolved? |
| From | Jonas Thörnvall <jonas.thornvall@gmail.com> |
Den måndag 8 oktober 2018 kl. 06:45:35 UTC+2 skrev JJ:
> On Sun, 7 Oct 2018 10:06:51 -0700 (PDT), Jonas Thörnvall wrote:
> > I am trying to get my sequenser to handle sysex messages. The procedure is
> > pretty simple
> > if (navigator.requestMIDIAccess) {
> > navigator.requestMIDIAccess(
> > {sysex: true} //Yeah it is just to set sysex : true
> > )
> > .then(success, failure);
> > }
> >
> > Problem is that the sysex : true generate a message box event. that have
> > to be answered.
> >
> > file: /// wants to use your midi device
>
> That message box is part of the web browser security system. It can't be
> bypassed unless the site in added into the allow list.
>
> > But the program runs on so it gets success and try to read in ports, but
> > apparently the midiobject is not accessible until the alert box event
> > answered.
>
> `requestMIDIAccess()` is an asynchronous method. If the script tries to
> access the resource without waiting for the resourse to be available, then
> it's guaranteed to fail.
>
> > How can i sidestep that problem or somehow wait for the alert box to be
> > closed, because i guess that is the problem with the ports within
> > midiobjects not accessible. Works fine when sysex false.
>
> You're asking about hacking a security system. The answer would obviously be
> no.
One could think of it like this we create another function that main that will wait for the alert box to get resolved. Let us call it waitAlertBox(); from the we will call our "main.js which call listport function.
Now the question become how do we know the state of the alert box? I have no idea have you? It must have some property value "resolved true or false"?
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Catching event from message alert box, and wait until resolved? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-10-07 10:06 -0700
Re: Catching event from message alert box, and wait until resolved? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-10-07 16:12 -0700
Re: Catching event from message alert box, and wait until resolved? JJ <jj4public@vfemail.net> - 2018-10-08 11:45 +0700
Re: Catching event from message alert box, and wait until resolved? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-10-07 22:58 -0700
Re: Catching event from message alert box, and wait until resolved? JJ <jj4public@vfemail.net> - 2018-10-10 05:39 +0700
Re: Catching event from message alert box, and wait until resolved? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-10-09 21:50 -0700
Re: Catching event from message alert box, and wait until resolved? JJ <jj4public@vfemail.net> - 2018-10-11 20:40 +0700
Re: Catching event from message alert box, and wait until resolved? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-10-11 15:11 -0700
Re: Catching event from message alert box, and wait until resolved? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-10-14 20:56 -0700
Re: Catching event from message alert box, and wait until resolved? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-10-07 23:13 -0700
Re: Catching event from message alert box, and wait until resolved? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2018-10-08 08:09 -0700
csiph-web