Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a profile trigger to associate with a website #4442

Open
nvaccessAuto opened this issue Sep 5, 2014 · 30 comments
Open

Add a profile trigger to associate with a website #4442

nvaccessAuto opened this issue Sep 5, 2014 · 30 comments

Comments

@nvaccessAuto
Copy link

Reported by blindbhavya on 2014-09-05 11:28
The summary should have explained this completely.
So, is it possible to have a profile trigger in NVDA to associate with particular websites, like we can for particular applications?
Actually, while reading conversations in GMail (webmail) all e-mails are in tables, and I only want tables reporting off for whole of GMail.

@nvaccessAuto
Copy link
Author

Comment 2 by jteh on 2014-09-06 01:38
The main question that needs to be answered is how a website is specified.

  • It can't just be the URL because that would probably only cover one page on the site, whereas you probably want it to cover many pages on the same site.
  • Perhaps it could be the domain, but that might be too broad or too narrow depending on the site. Still, I believe this is how browsers associate quite a few things.
  • Regular expressions or glob patterns might be nice, but they are hard for users to specify and also can't be looked up fast.

@nvaccessAuto
Copy link
Author

Comment 3 by blindbhavya (in reply to comment 2) on 2014-09-06 05:09
Replying to jteh:

The main question that needs to be answered is how a website is specified.

  • It can't just be the URL because that would probably only cover one page on the site, whereas you probably want it to cover many pages on the same site.

Agreed

  • Perhaps it could be the domain, but that might be too broad or too narrow depending on the site. Still, I believe this is how browsers associate quite a few things.

Sorry, did not understand, what could be broad and narrow and how would its length relate to this? I think the doman name suggestion could work.

  • Regular expressions or glob patterns might be nice, but they are hard for users to specify and also can't be looked up fast.

If the user has to specify regular expressions, then I agree that it is too difficult for most users like me.

@nvaccessAuto
Copy link
Author

Comment 4 by jteh (in reply to comment 3) on 2014-09-06 10:04
Replying to blindbhavya:

  • Perhaps it could be the domain, but that might be too broad or too narrow depending on the site.

Sorry, did not understand, what could be broad and narrow and how would its length relate to this?

Well, what if there are two things at the same domain but you only want a particular profile to match for one of them? And even aside from that, what level would you match? For example, if the domain is foo.bar.com, do you match bar.com or just foo.bar.com?

@nvaccessAuto
Copy link
Author

Comment 5 by blindbhavya on 2014-09-06 11:47
Hi.
Here I think you should just match exactly what the user has specified that is foo.bar.com.
What do you say?

@nvaccessAuto
Copy link
Author

Comment 6 by jteh on 2014-09-06 12:07
Unfortunately, it's just not that simple.

  • Many times, if users try to enter this, they'll get it wrong. For example, I'll wager most users will try gmail.com for Gmail, but actually, Google redirects you to mail.google.com and all of the content is there.
  • As an example, what if the user had just entered google.com? Should that match mail.google.com or not? Should it match www.google.com? If I understand your idea correctly, neither of these would match, but the latter in particular might not be what the user intended.

@nvaccessAuto
Copy link
Author

Comment 7 by nvdakor (in reply to comment 5) on 2014-09-06 12:11
Replying to blindbhavya:

Hi.

Here I think you should just match exactly what the user has specified that is foo.bar.com.

What do you say?

Personally, I'm a bit cautious about just using a domain/URL. Consider the following scenarios:

  1. You wish to set a profile for a page that is somewhere within this domain. For example, suppose www.google.com doesn't need any custom profile, but www.google.com/search may require use of a custom profile to announce object descriptions.
  2. Suppose if the subdomain changes. For example, suppose we have a profile for www.yahoo.com. The next day, Yahoo! experiences server outage so decided to use www2.yahoo.com instead. A user who may not be aware of this change would assume that his or her profile will still work for Yahoo! pages, but finds out it doesn't anymore simply because the subdomain has changed (a subdomain is part of a site which has its own domain-like URL, such as community.nvda-project.org versus www.nvda-project.org).
    A few other things to consider:
  • Web and web technologies change rapidly: a profile defined for a website may become obsolete if something that the profile relies on is gone. For example, suppose if a site is using frames for layout purposes, and you told NVDA to not announce frames for example.com. A few months later, the site's webmaster decides to use tables instead, and a user who is not aware of this change would feel annoyed that one needs to modify the configuration profile for the website. Imagine this website changing its layout every day, or for that matter, every hour (the rate at which web technologies change will increase).
  • Web servers are more "sympathetic" to device configurations now than before. In other words, depending on what the client declares itself to be, a web server (the computer which hosts websites) will let the client browser display content that is relevant. For example, if someone visits www.google.com on a tablet, Google would send content optimized for touchscreens, versus showing the full site when a desktop browser is used. This gets a bit complicated now that Windows 8.x includes two (yes, two) versions of Internet Explorer (a touch-optimized version and a full desktop mode).
  • Different browsers display content differently. For example, some elements may be present when browsing the site with Internet Explorer, whereas Firefox may not display that element. This is problematic for a custom profile which relis on this "unseen" element - if you use that profile in IE, the profile will take over, but if viewed from Firefox, the profile would be useless.
    Hope this makes sense. Please feel free to comment if you have any questions. Thanks.

@nvaccessAuto
Copy link
Author

Comment 8 by blindbhavya on 2014-09-06 15:17
Hi.
You all have made extremely valid points.
Thanks for the detailed clarifications.

@nvaccessAuto
Copy link
Author

Comment 9 by vgjh2005 on 2014-09-12 01:42
Hi:
Good points!
Thanks!

@nvaccessAuto
Copy link
Author

Comment 10 by bhavyashah on 2015-09-21 11:03
Hi,
An update to this ticket.
I was reading What's New in JAWS 17, and found the following two sections of particular interest:
Use Settings Center to Configure Settings for a Specific Web Site
In JAWS 17, you can now apply settings changes to a specific web site domain using Settings Center. For instance, if you use Smart Navigation and you have a particular web site where you would prefer not to have this feature active, you can open Settings Center from the current site and turn it off. Smart Navigation will continue working on all other web sites.
To configure web site specific settings, do the following:

  1. Open the web site where you want settings changes to apply.
  2. Press INSERT+F2, select Settings Center, and press ENTER.
  3. Press SHIFT+TAB to move to the application list and locate Default. Press DOWN ARROW one time and you should find the name of your current site followed by (domain). For example, if you open Settings Center from the Freedom Scientific web site, you should see something like www.freedomscientific.com (Domain).
  4. While the web site name is selected, press TAB to move to the Search edit and type all or part of the setting you want to change. For example, "smart" for Smart Navigation, "Forms" for Forms Mode options, etc.
  5. Press DOWN ARROW to move to the filtered results of the Settings Center tree view and make your preferred settings changes.
  6. Press TAB to move to the OK button and activate it with the SPACEBAR. The changes are made and saved. Settings Center closes.
    Now, whatever you have set for the current web site should only be applied when any pages on this site are open and have focus. For example, if you set Smart Navigation to Controls and Tables for the Freedom Scientific web site, it should be off for all other web sites which is the default, unless you are on Freedomscientific.com.

Create domain specific scripts for Web Pages and Web Applications
JAWS has always provided the ability to script desktop applications, enabling many non-standard applications to be made accessible to JAWS users. In recent years, however, more and more applications are being developed to run inside web browsers. For example, Microsoft SharePoint and Google Docs are web applications that allow you to create, edit, and save documents, as well as collaborate with other users, directly through web pages opened in Internet Explorer or Firefox.
Since each web application can offer its own unique functionality, the JAWS scripts for the web browser are too general to be of use for specific pages. JAWS 17 extends the scripting functionality to enable you to create scripts that only load when a particular web site is being accessed, so you can customize a web page or application to your specific needs. For instance, if you created scripts for www.microsoft.com, these scripts would be loaded for any page opened on the Microsoft web site. Domain specific scripts are loaded on top of the browser scripts so that JAWS can fall back to the general scripts in situations where a domain specific script behavior is not available. This gives scripters much more control when scripting a web-based application for a client at a job site as they can create specific functionality for the application without affecting how JAWS performs on other web pages.
To aid in creating domain specific scripts, three new script functions have been added.
• GetDocumentXML: This function obtains well-formed XML from the Dom Server for parsing using the MSXML com object.
• PerformActionOnElementWithTagAndAttribute: This function finds an element in the DOM by tag and attribute/value pair and performs an action on it such as setFocus, makeVisible, doDefaultAction, leftClick, or rightClick.
• PerformActionOnElementWithID: This function finds an element in the DOM by unique ID and performs an action on it such as setFocus, makeVisible, doDefaultAction, leftClick or rightClick.
Using these functions, you could write scripts to do things like find and speak a particular heading, add the numbers in the last row of a table and speak the total, and much more, all without moving the Virtual Cursor.
To demonstrate domain-specific scripting, we have included sample SharePoint scripts that allow you to access web-based toolbars on a SharePoint domain using the INSERT+CTRL+F8 keystroke. To enable these sample scripts, do the following:

  1. Create a confignames.ini file in your JAWS user settings folder located at C:\Users\Your User Name\AppData\Roaming\Freedom Scientific\JAWS\17.0\Settings\enu.
  2. Add the following lines.
    [Domains]
    fsservices-my.sharepoint.com=SharePointWeb
    If the scripts are not working, meaning that toolbars cannot be activated with the INSERT+CTRL+F8 keystroke, check the address of the current domain. If necessary, add another line to your confignames.ini to enable that domain to be recognized so that the sharePoint sample scripts load.

Well, now, one might consider me a user who wants some JAWS stuff to be ported over to NVDA as well. But, I had felt this requirement long before JAWS 17 news came out.
Could the above two excerpts or more information from Freedom Scientific give you some ideas as to how Freedom Scientific addressed the challenges and complications you were conceiving? Could this still have some likelihood of making its way into NVDA as well? My use case is still the GMail website as the most prominent one, although there are other websites I frequently visit and I see potential setting changes I would like to make.
Please do not misunderstand me as a JAWS copycat - rather, I would just like to revisit this feature possibility with these developments.
Best Regards,
Bhavya Shah.

@nvaccessAuto
Copy link
Author

Comment 11 by jteh on 2015-09-21 21:51
It does seem that more and more things are starting to settle on domains as the primary identifier for a site or app. I guess we could implement an exact domain match profile trigger and see what happens. I don't think we should do subdomain matching, path matching, etc., though.

@codeofdusk
Copy link
Contributor

Any news on this issue?

@jcsteh jcsteh removed their assignment Aug 10, 2017
@Brian1Gaff
Copy link

Brian1Gaff commented Aug 10, 2017 via email

@mikolysz
Copy link
Contributor

mikolysz commented Jul 7, 2018

I propose implementing this in the following way:

  1. Add a button to the profiles or triggers dialog that takes us to a new dialog, perhaps called web rules or something like that.
  2. The dialog should consist of a list of mappings of websites to profiles, and buttons to manage those mappings ("add", "edit", "remove"). It should be a bit similar to the speech dictionary dialogs.
  3. The add/edit mapping dialog should consist of the following:
    • type (radio button): - How the URL should be interpreted, possible options should be "domain", "specific page URL" and "regexp"
    • URL (text box): the URL to map:
    • Profile (combo box): the profile to map to.
    • Limit to (combo box): what browser to limit this mapping to, possible options: "no limit", "Internet Explorer", "Firefox", "Chrome" etc.
    • A button or similar to see the list of websites currently open (optional)
      NVDA should ensure that there exist no two mappings with same URLS, types and limit settings.
  4. When the page's URL changes, the following steps should be performed:
    • Find a mapping with type "specific page URL" and it's URL set to the new page URL. If found, use it, if not, keep searching.
    • Match every regexp based mapping with the new URL. Use the first successful match if there's one.
    • Try to find a domain-based mapping, starting from the most specific domain and ending with the least specific. For example, for pl.wikipedia.org the order would be pl.wikipedia.org, wikipedia.org and org.
    • If none of the above yielded any results, assume there's no mapping for that document.
  5. Make the domain matching API available for the addons, so writing addons for specific domains becomes possible.

Use cases covered by this implementation include:

  • A user wants to set a specific synth/voice/language for a specific website, i.e. pl.wikipedia.org. In that case, they create a domain mapping for pl.wikipedia.org and a profile, "wikipedia", adjusting the settings in that profile.
  • A user wants all websites in the .pl domain to default to polish if language isn't encoded in the document, keeping their system and the rest of NVDA in english. To do this, he adds a domain mapping for pl and assigns it to the profile with the necessary adjustments.
  • A user who prefers using human sounding synths wants to switch to Espeak on all porn websites so his peers can't understand what the computer is saying and what he's up to. To do this, he makes a regexp mapping for porn|sex|adult etc.
  • A user who accesses some document, i.e. a reference documentation for some library or SDK very often creates a mapping to a profile with apunctuation setting set to all. The type of mapping depends on how the documentation is organized. For simple libraries, it could be a single URL mapping, for more complex ones spanning multiple pages, a domain or regexp mapping would be more suitable.
  • A sysadmin who often deals with configuration of network hardware that often uses ancient web technologies such as frames and tables for presentation wants to disable reporting of such items in those devices' control panels. To do this, he uses an imperfect solution, a regexp mapping of all URLs that have an IP address, perhaps only that in the ranges for local networks, instead of a DNS hostname to the appropriate profile. The user does this with the assumption that most devices he configures are on a local intranet, most likely in the 192.xxx.xxx.xxx or 10.xxx.xxx.xxx ranges. It's important to mention that this design allows the user to get the frames and tables back for specific URLs if he so wishes. To do this, he creates a mapping for those specific URLs which overrides the regexp.
  • A user who wants to have closed captions read to them, even on websites that don't expose them as an aria live region, can write themselves an addon using that API. When the addon detects that the user visited one of the pre-programmed URL patterns, it makes the neccessary adjustments to the way NVDA reads the document.
  • A developer who wishes to make accessing some very important data on a website more readily available may write an addon that speaks this data when certain hotkeys are pressed. With this API, he can restrict this addon to specific websites. This is useful because some websites display various information in distinct parts of the HTML document, making jumping between them pretty hard, but they use css to make them prominent on the screen. For sighted people, it's enough to glance at the screen to see them, but blind people need a lot of time to acess them, especially if the information they need is scattered around the document and they want to read all of it quickly. A sample use case that comes to mind is checking the title of the currently playing song on an online music streaming service without interrupting the browsing of other aspects of that service. We might, for example, browse an album but want to check what's that new song that just started playing. A sighted person usually sees this inforation at the bottom of their scree, while a screen-reader user needs to leave the songs list, get to it and return back, perhaps losing their place. There are too many services and use cases to implement this in core, so this is a functionality for the addons. However, the addons could use better support for such use cases in NVDA itself.

@Adriani90
Copy link
Collaborator

Another use case: websites with many nested tables where the user does not want tables to be reported.
Or websites with tables formated as layout tables where table navigation works only when layout tables are enabled in browse mode settings of NVDA.
cc: @feerrenrut, @LeonarddeR, @lukaszgo1

@sine-w
Copy link

sine-w commented Feb 4, 2021

I do love this function
I have profile for word editing, and will be triggered by word or notepad, I would also want this function to be triggered when I use online text editing site, e.g. google doc.
If it is possible to match based on program title like that of Autohotkey?

@feerrenrut
Copy link
Contributor

Looking over the history of this issue, I see one of the concerns was about getting the user to enter the correct URL. One thing I have seen certain tools do is to auto-populate with the URL of the current page, then provide a slider to generalize the URL. The slider essentially removes bits from the end until it gets back to the TLD. Then a regex can be used to match. One piece of software I use has two sliders, one for the subdomains, and one for the path.

Technical detail:
The url of the page can be retrieved with ISimpleDomDocument::get_URL()

@jcsteh
Copy link
Contributor

jcsteh commented Feb 4, 2021

I'd advise against using ISimpleDOMDocument, as although it's still supported, it's considered deprecated. However, you can use IAccessible::accValue on the document accessible. Note that vbufs already have a documentConstantIdentifier property (I think that's what it's called, don't have the code in front of me) which fetches this.

@jcsteh
Copy link
Contributor

jcsteh commented Feb 4, 2021

One of my other concerns with implementing this is that pattern matching is potentially expensive, since you have to match against each pattern O(n). Ideally, like we do for other profile specs, it could be done with a hash lookup. Whether that's actually a problem in reality is an open question. Also, these days, it's more common for different web apps to have different domains, so maybe domain/subdomain is sufficient. Anyway, just food for thought rather than a real opinion.

@feerrenrut
Copy link
Contributor

feerrenrut commented Feb 9, 2021

Note that vbufs already have a documentConstantIdentifier property

Yes, an abstraction is probably appropriate, I was discouraged from using accValue on the document in Chrome. With an abstraction we we can have browser specific implementations as appropriate

One of my other concerns with implementing this is that pattern matching is potentially expensive, since you have to match against each pattern O(n)

For small values of N this will likely be fine. If we find that it becomes a performance issue we can look for ways to optimize it, and I think there would be lots of approaches but they all introduce complexity. As part off this we could look at what the limit is for N before performance is an issue and decide whether that is a realistic number of profile triggers.

@NiranjanGVala
Copy link

Is there are any updates on this issue? If jaws can manage to do this, then why not the NVDA? It would be very helpful if implemented. I think many NVDA users want this functionality & they are missing so something needs to be done for this functionality.

@cary-rowen
Copy link
Contributor

Yes, it will be very useful.

@XLTechie
Copy link
Contributor

XLTechie commented Apr 25, 2021 via email

@CyrilleB79
Copy link
Collaborator

@JulienCochuyt I guess you or other people of @accessolutions have already worked on such problem. If yes, your experience may be valuable.

@JulienCochuyt
Copy link
Collaborator

JulienCochuyt commented Apr 26, 2021

@CyrilleB79 wrote:

@JulienCochuyt I guess you or other people of @accessolutions have already worked on such problem. If yes, your experience may be valuable.

Indeed, I'm actually pretty amazed I've never come up to this ticket before. Thanks for pointing it out.
Our WebAccess addon does indeed implement what is barely an equivalent of an AppModule for a web application.
We call it a WebModule.
Through a UI we aim at being as simple as possible for its complex outcomes, it allows to define specific behaviors depending on the page currently browsed. Among many other things, it allows for example to define a gesture to jump to specific locations or set the missing semantics on elements such as missing headers or regions.
Actually, all use cases listed by @mikolysz in #4442 (comment) can be fulfilled either through the standard UI or through custom code extensions.
The addon originates from work done to enhance the comfort and productivity of visually impaired agents of Pole emploi, the French employment agency. It's been successfully used in different corporate environments for years and we hope to finally give it enough polish for general public use in the near future.
We've had the chance to present it to @michaelDCurran and @LeonarddeR at SightCity in Frankfurt a few years ago.
A common demo at that time was to demonstrate complete keyboard control upon the Youtube player. (It was not a native feature back then.)

Regarding how WebAccess determines which WebModule to load, we"ve actually settled on a technique pretty close to what @feerrenrut describes in #4442 (comment) but in reverse order:
The user is presented with a drop-down containing the possible choices from the most stripped down (only the bare domain) to the full path and query being currently browsed:

  • example.tld
  • example.tld/a
  • example.tld/a/b
  • example.tld/a/b?q=c

Each WebModule defines a set of URL snippets for which it should be loaded.
The same module can then be loaded for the test and production environments of the same web application.
To handle corner cases where a set of URL snippets cannot do the job, it also support being loaded based upon the current title of the web page as displayed in the title bar of the browser, but this turns out to be really rarely used.

Regarding triggering a NVDA profile switch: It is something we've considered for a long time but never took the time to implement due to the lack of demand. Given the interest shown here, we'll definitely re-prioritize it.

cc @frederic-brugnot
cc @rthxy

@Adriani90
Copy link
Collaborator

I am struggling with this problem quite alot, when I am working with Google apps for example.

  1. When navigating websites, usually I disable report dynamic content in NVDA's object presentation settings. However, when working with Google sheet, I need this setting because otherwise the names of the sheets are not reported. Also cells with popups, formulas, comments etc. are only reported as such when dynamic contenct is enabled.
  2. When working in google docx also many status messages are reported through dynamic content
  3. Cell coordinates during table navigation are for me not important on websites, but in tables such as in google sheets they are very critical.

How about creating an browser addon which communicates with NVDA settings in the background? This could be delivered together with the NVDA installation if the user wishes. And it would install this addon for the Cromium browsers at least.

This browser addon could then provide the possibility to choose from the current profiles created in NVDA and alocate a link to it. NVDA applies then the coresponding settings for that specific link, or for the entire web app.

@Adriani90
Copy link
Collaborator

cc: @aleventhal, @ObjectInSpace for Crome;
@jcsteh for Firefox.

@cary-rowen
Copy link
Contributor

Hi @Adriani90

I have the same troubles as you, So I'm very hopeful that this will actually be implemented.

@thgcode
Copy link
Contributor

thgcode commented Nov 1, 2022

Any news on the code of web module or the addon?

@NiranjanGVala
Copy link

NiranjanGVala commented Nov 1, 2022 via email

@artindk
Copy link

artindk commented Dec 6, 2023

Can this be looked at again? I think this feature is very important in this day and age, in fact I consider this feature more important than triggers for local aplications. After all, we are using more and more web apps and less and less local programs. People use webmail and online calendars, and at my work, for example, almost only web apps are used as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests