-
Notifications
You must be signed in to change notification settings - Fork 975
Conversation
@@ -452,7 +452,10 @@ class Frame extends ImmutableComponent { | |||
break | |||
case 'view-source': | |||
const sourceLocation = UrlUtil.getViewSourceUrlFromUrl(this.webview.getURL()) | |||
windowActions.newFrame({location: sourceLocation}, true) | |||
let src = this.frame.get('src') | |||
if (UrlUtil.isHttpAddress(src) && !UrlUtil.isImageAddress(src)) { |
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 split this change out from the shortcut? I think we probably want to make these extra checks in getViewSourceUrlFromUrl
and maybe return a null location if there is not valid view-source for the url
@bradleyrichter is this shortcut in your list?
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.
Good point, moved.
If you type in gmail compose, or any text editable for example, and do command+U to underline it, it'll open the page source in a new tab instead. I tweaked it to be the same shortcut as Chrome (with an Alt key too and merged. Thanks!) |
@bbondy I think you forgot to put the check for the current address like I did in my PR, so if you click CTRL + ALT + U on new tab frame or on a image you currently opened in a browser you will trigger view-source, which does not happens on other browsers and should not happen in Brave as well. Please see my PR for reference how I have checked this, so you can put that too :) |
The task was merged so it is all commits |
I only merged your PR and then did a commit on top. |
@bbondy Ah never mind my comment I tought you closed my PR without merging it because github stated |
Added handy shortcut to display page source, just like in Google Chrome.
cc @bbondy @bridiver @bsclifton