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

Workaround Windows issue with URL prompt #21103

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -91,7 +91,10 @@ impl Browser {
self.event_queue.push(WindowEvent::Reload(id));
}
}
(CMD_OR_CONTROL, Some('l'), _) => {
// FIXME (#17146): Workaround for Ctrl + L not working on Windows.
// When #17146 is fixed revert this line back to:
// (CMD_OR_CONTROL, Some('l'), _) => {
(CMD_OR_CONTROL, _, Key::L) => {

This comment has been minimized.

@paulrouget

paulrouget Jul 5, 2018

Contributor

Can you keep branches?

This comment has been minimized.

@atouchet

atouchet Jul 5, 2018

Author Contributor

I'm not entirely sure what you mean by that.

This comment has been minimized.

@paulrouget

paulrouget Jul 6, 2018

Contributor

Would it work if you keep both (CMD_OR_CONTROL, Some('l'), _) and (CMD_OR_CONTROL, _, Key::L)?

This comment has been minimized.

@atouchet

atouchet Jul 6, 2018

Author Contributor

You mean like this?

(CMD_OR_CONTROL, Some('l'), _) => {
                if let Some(id) = self.browser_id {
                    let url: String = if let Some(ref current_url) = self.current_url {
                        current_url.to_string()
                    } else {
                        String::from("")
                    };
                    let title = "URL or search query";
                    if let Some(input) = get_url_input(title, &url) {
                        if let Some(url) = sanitize_url(&input) {
                            self.event_queue.push(WindowEvent::LoadUrl(id, url));
                        }
                    }
                }
}
(CMD_OR_CONTROL, _, Key::L) => {
                if let Some(id) = self.browser_id {
                    let url: String = if let Some(ref current_url) = self.current_url {
                        current_url.to_string()
                    } else {
                        String::from("")
                    };
                    let title = "URL or search query";
                    if let Some(input) = get_url_input(title, &url) {
                        if let Some(url) = sanitize_url(&input) {
                            self.event_queue.push(WindowEvent::LoadUrl(id, url));
                        }
                    }
                }
}

I haven't actually tested this code and was going completely off of @jklepatch's previous commit so I am not sure if it works. My Rust knowledge is quite limited so I probably won't be able to continue this PR if it requires any major changes.

if let Some(id) = self.browser_id {
let url: String = if let Some(ref current_url) = self.current_url {
current_url.to_string()
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.