Your first version works quite well!
Is there a reason you removed the function BTTNotification(note) {}? It allows you to immediately get the now playing info when it changes, without having to constantly query BTT.
Small issue: the variable playingt is currently undeclared, thus throwing an exception.
BTT calls this function BTTNotification(note) {} every time a variable in BTT changes (and for some other things), thus it immediately notifies the webview when the now playing information has changed, so it can only call the update methods then. This would be more performant than intervals.
Async / await & intervals are both useful, I like async await because I don't have to work with callbacks so it's easier to read for me Intervals are still needed with async await though.
One more hint: use let instead of var whenever possible. Var has a lot of weird behavior
Actually i'm comparing async / intervals when floating window closed. i guess intervals not using resources when mcc not in use
I think you use spotify when you have a issue about playingt variable, i didnt tested mcc on spotify app or web. I have to listen some songs on there for testing
If it's ok for you I'll link your Control Center & Window Manager in an upcoming blog post about the Floating HTML View. I think they are great examples of what can be achieved. I'm currently writing completely new documentation for the webview with many examples and will be publishing a blog post when I'm done.
Hello, just tried your v0.1 preset @yw4z and it asks me for the shared secret every single time i click on a button. I managed to figure out what my BTTHTMLScriptingSharedSecret was by going into my keychain. So entering that into the popup that asks for my shared secret totally works but i have to input it every single time i click on any button which is a pain. How do i set it once and for all?
delete it from keychain for now, I think there is a bug which doesn't show previously set secrets on your machine correctly. I'll have a look. (You probably previously set a shared secret for some webview)
@Ryan_Mak double click title bar or use fn+1 shortcut, it shouldn't be problem if you dont use these shortcuts for other triggers, always you can customise settings
@sundar2012 i didnt add tooltips. because not needed on this one. i guess if apple made this, they didn't add too. but i need some help on customising icons. i will design a settings pane but i'm not sure how can i change icons of mcc with a external html page
@sundar2012 im not planning to add tooltips but i was thinking to add these type notifications for changes (ex wifi on/off, next track ... ). Also it can work like tooltips when user waited for a while on icon. I can add this if you help on this
@yw4z to save data / settings for your config window I'd put them into a JS object and then just use JSON.stringify and save it into a BTT string variable (using BTT's set_string_variable), then when getting the string variable you can use JSON.parse to decode it again.
Also I think the new "Custom Menubar Icon" could be great to access your control center:
I will try to do mcc settings, probably it will not done in near future thanks for guide
That menubar icon looks like nice feature, i will try that for SWM too
How do you get the code out and customize it in BTT? Can't seem to find the settings used by the preset in BTT. Dragging the file into Sublime Text does not seem to work.