Open a link in ui.browseableMessage()?


coscell@...
 

Hello

If I open a link in ui.browseableMessage() then it always start Internet Explorer. May I change it?

Appreciate your answers.

Coscell


Rui Fontes
 

Hello!


As far as I know, with ui.browseableMessage the links are always directed to Internet Explorer...

Only way I see to avoid that is creating, a html file using "with open" and then:

        # Opens our html file on default browser.
        webbrowser.open(item.getDocFilePath())


Rui Fontes



Instead

Às 01:33 de 04/08/2021, 高生旺 escreveu:

Hello

If I open a link in ui.browseableMessage() then it always start Internet Explorer. May I change it?

Appreciate your answers.

Coscell




anthony borg
 

Hi rui

How to create a html file in a brouser please?
Thanks in advance

Anthony

-----Original Message-----
From: nvda@nvda.groups.io <nvda@nvda.groups.io> On Behalf Of Rui Fontes
Sent: 04 August 2021 13:58
To: nvda@nvda.groups.io
Subject: Re: [nvda] Open a link in ui.browseableMessage()?

Hello!


As far as I know, with ui.browseableMessage the links are always directed to Internet Explorer...

Only way I see to avoid that is creating, a html file using "with open"
and then:

# Opens our html file on default browser.
webbrowser.open(item.getDocFilePath())


Rui Fontes



Instead

Às 01:33 de 04/08/2021, 高生旺 escreveu:
Hello

If I open a link in ui.browseableMessage() then it always start
Internet Explorer. May I change it?

Appreciate your answers.

Coscell





Rui Fontes
 

Hello!


Using some of my add-ons code:


    _NRIniFile = os.path.join(globalVars.appArgs.configPath, "NVDARecord.html")

    message = u"<h1>{title}</h1><br>".format(title=_("List of commands for running add-ons"))
    for addon in sorted(addonDic, key = lambda item: item.lower()):
        message += u"<h2>{addonSum}</h2>\n<table>\n<tr><th>".format(addonSum=addon)
        #. Translators: The title of the column containing the documentation of each of the scripts.
        message += _("Documentation")
        message += "</th><th>"
        #. Translators: The title of the column containing the command of each of the scripts.
        message += _("Gesture")
        message += "</th></tr>\n" script = addonDic[addon])
        for gesture in sorted(script):
            message += u"<tr><td>{doc}</td><td>{gesture}</td></tr>\n".format (doc = script[gesture], gesture=gesture)

    with open(_NRIniFile, "w", encoding = "utf-8") as file:

        file.write(message)

    # Opens the help of our addon on default browser.
    webbrowser.open(item.getDocFilePath())

I didn't check rigorously the identation...

And I didn't check the result, but theorically, it should result...


Rui Fontes


Às 18:20 de 04/08/2021, anthony borg escreveu:

Hi rui

How to create a html file in a brouser please?
Thanks in advance

Anthony

-----Original Message-----
From: nvda@nvda.groups.io <nvda@nvda.groups.io> On Behalf Of Rui Fontes
Sent: 04 August 2021 13:58
To: nvda@nvda.groups.io
Subject: Re: [nvda] Open a link in ui.browseableMessage()?

Hello!


As far as I know, with ui.browseableMessage the links are always directed to Internet Explorer...

Only way I see to avoid that is creating, a html file using "with open"
and then:

# Opens our html file on default browser.
webbrowser.open(item.getDocFilePath())


Rui Fontes



Instead

Às 01:33 de 04/08/2021, 高生旺 escreveu:
Hello

If I open a link in ui.browseableMessage() then it always start
Internet Explorer. May I change it?

Appreciate your answers.

Coscell