-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Remove contributors file from NVDA, read license as HTML #17600
base: master
Are you sure you want to change the base?
Conversation
Alternatively: |
Co-authored-by: Cyrille Bougot <[email protected]>
Simplicity really - we don't need to store or use the HTML file anywhere else unlike other documentation. |
See test results for failed build of commit 65aaa9bac2 |
See test results for failed build of commit 77d2f0a914 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good, and the size of the license on screen looks good for me.
Made a suggestion about noting the date of archiving the contributors file, otherwise all good.
@coderabbitai could you create an issue to investigate renaming copying.txt to LICENSE.md in order for GitHub to pick up the license? |
Tip For best results, initiate chat on the files or code changes. @LeonarddeR I've created issue #17621 to track the investigation of renaming copying.txt to LICENSE.md for better GitHub license detection. 🔗 Analysis chain@LeonarddeR I've created a new issue to track the investigation of renaming copying.txt to LICENSE.md for better GitHub license detection. 🏁 Scripts executedThe following scripts were executed for the analysis: Script:
Length of output: 60 Script:
Length of output: 843 |
|
||
@blockAction.when(blockAction.Context.SECURE_MODE) | ||
def displayLicense(): | ||
# HTML includes links which shouldn't be accessible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this comment, it's however not clear from the comment how activating links is avoided here. I assume that links are not rendered in browseable messages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's avoided by the blocking the whole action with the blockAction. Links are rendered in the browseable messages. I'm not sure if I can place the comment any closer to the decorator while keeping formatting happy. Maybe
@blockAction.when(
# HTML includes links which shouldn't be accessible
blockAction.Context.SECURE_MODE
)
def displayLicense():
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see now, thanks for clarifying.
Can't we instruct nh3 to strip links in a secure context, for example by providing an empty list of url schemes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but I think it's useful for these links to work, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It definitely is 😉
However, we can make the behavior of nh3 differ from the default behavior when in a secure context, for example:
if secureContext:
attribute_filter = lambda tag, attr, val: None if tag.lower() == "a" and attr.lower() == "href" else val
else:
attribute_filter = None
In secure context, we probably also want to pass something like url_schemes=set() to ensure that external comments will never load.
The latter might even be enough, as long as we don't provide something like <a href="something">something</a>
as these won't be filtered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SaschaCowley - do you think this is necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially useful, but not necessary. Note this would also require changes to browsable message, which is currently not available when running on a secure desktop.
Lines 156 to 158 in fa619c2
if isRunningOnSecureDesktop(): | |
_warnBrowsableMessageNotAvailableOnSecureScreens(title) | |
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your first suggestion (putting the explanatory comment in the decorator) is the way to go here, @seanbudd
@seanbudd if I build a launcher from this branch, the HTML view containing the licence is not accessible unless I click on it. Speech viewer output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good.
Link to issue number:
Closes #17529
Closes #16922
Summary of the issue:
There is a transient bug with Windows that prevents opening the "contributors" and "license" file in notepad.
The contributors file is no longer maintained or useful, so this should instead be archived.
The license file is written in markdown, but displayed as plain text in notepad, or as a plain text scrollable text window. This makes it hard for users to read.
Description of user facing changes
From the installer, this is an embedded WebView, from the menu, this is a browseable message.
Description of development approach
Testing strategy:
Tested creating an NVDA installer and reading the license and opening the license from the NVDA menu.
Known issues with pull request:
Code Review Checklist:
@coderabbitai summary