HTML / DOM interactions
It would be amazing if we could trigger presses on elements on web pages. It'd open up creating remotes on a lot of web interfaces that don't have many shortcuts and could lead to some unique remotes that aren't media-related (e.g. social media remotes, video games that aren't shortcut based, etc). It would help with setting focus as well.
There is a findimage() function in the win library and perhaps this could be something similar but for all types of elements. findimage() won't always work because there are multiples of the same image, and the image itself may be inserted in CSS rather than HTML. Another good example of it not working is with the Crunchyroll anime video site. The buttons for previous and next episode are actually a single arrow image that is rotated in CSS for different directions.
Something like this could work though:
local dom = require("dom"); element = dom.getbyid(tag, id, [window/tab]) element = dom.getbyclass(tag, class, [window/tab]) element = dom.getbyattribute(attribute, value, [window/tab])
submit_button = dom.getbyid("button", "submit", hwnd); flash_player_frame = dom.getbyclass("object", "swf_player", hwnd_children); current_selection = dom.getbyattribute("checked", "true", hwnd);
This could then also be used to grab values:
dom.getval("submit_button", "id"); --returns "submit" dom.getval("flash_player_frame", "width"); --returns 960 dom.getval("current_selection", "type"); --returns "radio"
Pretty please with a donut on top? :D
This is something we are looking at. The problem is that there is no good way to get the HTML files. To make it happen we need to develop a plugin for each browser that can communicate with the server. We have made some prototypes but it needs a bit more work.
Ah okay, thanks for looking into this, that's great and I can understand why it might be a lot of work. Did a bit of research and maybe this could help?:
I've got a bit of web-scraping experience (Selenium, etc) but not an expert so not entirely sure if that's relevant to what you might want to achieve. Thanks for all that you guys are doing.
The problem is not to read the webpages there is already a lib for that: https://github.com/unifiedremote/Docs/blob/master/libs/http.md
The problem is to read the webpage that is already open in the browser and then get the browser to execute your commands.
Ah, yeah, sorry- thought it might not be relevant. Thanks for working on your own solution then!