minutekey / ez-access-web

Automatically exported from code.google.com/p/ez-access-web
0 stars 0 forks source link

Communication of EZ Access state with page scripts #117

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I think it would be useful (and easy to implement) for the page JS to know if 
the EZ Access highlight/mode is on or off. 

My proposal is to do this with the data-ez attribute. 
If a page has a data-ez attribute, it is EZ Access compatible and the extension 
could change its value to "on" or "off" or whatever with the mode of the 
system. 

If the page doesn't have the attribute, then the extension would not add either 
the data-ez attribute or value.

If we think we might want lots more communication, could we put a JSON object 
as the attribute value? So right now, the system could look for EZHighlight's 
value (on or off). In the future the system could look for foo's value--all of 
which are stored in the data-ez attribute.

Original issue reported on code.google.com by jbjor...@gmail.com on 24 Oct 2013 at 3:33

GoogleCodeExporter commented 8 years ago
I think if we're going to do this we might as well go all out and consider one 
of the following techniques:
http://stackoverflow.com/questions/9320427/best-practice-for-embedding-arbitrary
-json-in-the-dom

I'll look into it more. We'll just pass around a JSON blob to communicate. :P

Original comment by aeharding on 29 Oct 2013 at 5:25

GoogleCodeExporter commented 8 years ago
"All out" w/JSON sounds good. My suggestion is much like this answer 
(http://stackoverflow.com/questions/9320427/best-practice-for-embedding-arbitrar
y-json-in-the-dom#answer-9320477) from the stackoverflow Q&A you linked to.

Original comment by jbjor...@gmail.com on 29 Oct 2013 at 6:06