-
Notifications
You must be signed in to change notification settings - Fork 971
extension icons should appear #11143
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,13 @@ module.exports.fileUrl = (filePath) => { | |
return encodeURI('file://' + fileUrlPath) | ||
} | ||
|
||
module.exports.chromeUrl = (filePath = '') => { | ||
filePath = module.exports.fileUrl(filePath) | ||
filePath = filePath.replace('file://', 'chrome://brave') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. where is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also i'm curious what CSP violations are being triggered? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I played with the CSP file but couldn't get the violation to reveal itself either. It might be some other security restriction. The error from the console is
and it disappears when switching to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @diracdeltas chrome://brave can't be loaded from web pages There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, the csp can't allow something that is prohibited by default (access to file resources) which is why the file:// urls don't work There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's fine if chrome://brave URLs can be loaded manually from the urlbar since that is also possible for file URLs. just want to make sure there is nothing they can do that files URLs can't do, other than be loaded in the chrome:// context. |
||
|
||
return filePath | ||
} | ||
|
||
/** | ||
* Gets the URL of a page hosted by the braveExtension or torrentExtension | ||
* Returns 'chrome-extension://<...>' | ||
|
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.
would be good to have some unit tests for this
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.
added in 1bc13ba
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.
can we use a relative path instead and make it filesystem agnostic?