I’ve been trying to write a javascript that would light up the specific button on my streamdeck that corresponds to the active layout. But when I try to access the active_layout with javascript, I get this error:
Access to fetch at ‘http://10.210.240.12/admin/channel1/get_params.cgi?active_layout’ from origin ‘null’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.
We have an open feature request for CORS compatibility! I am not sure when it would be implemented but it is currently being analyzed. To be certain, there may be other ways you can change the stream deck buttons when a specific layout is active. This would be similar to how I used triggers for the “one touch” control on Stream Deck here:
so in this case, changing the colour of a layout button based on GET commands; when layout is active - trigger x colour.
This I haven’t tested, but I think in theory should be possible using the following API command: