-
Notifications
You must be signed in to change notification settings - Fork 44
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
Search in address bar is redirecting to website's search plugin #86
Comments
Isn't this how it was designed and always worked? Why is that behaviour not expected? |
Providing link manually in the address bar also leads to website's search plugin. |
I'm waiting for https://sugarlabs.org/ to return to normal service before I test this, but I think this behaviour is normal and expected for the Browse activity. |
If this behavior is normal then I would not like this issue to be tested. I did a wrong analyse of UX, So I am closing this issue 😊 |
I want my opinion tested. Is it coded to do this, or is it accidental? If it is not coded, why is it happening? |
This was discussed in #78 (comment) and further comments |
I see, thanks. Good memory. Mine was vague. @avinashbharti97, are you testing with the latest commit in Browse, or with a pre-installed Browse activity from Ubuntu 18.04? |
Yes, I am testing with the latest commit. |
Good, thanks. I'm also waiting for https://sugarlabs.org/ to return to normal service before I test this. If you know of another web site that triggers the behaviour, let me know. |
What is expected behavior of Browse when not connected to the internet, e.g. to a local server? With internet service available here, any reference to Google can cause a delay of minutes. |
Tested Browse-157.4 on Fedora 18, and Browse-202 on Ubuntu 18.04. Behaviour as discussed above does reproduce in both cases;
So the behaviour is not defined by Browse, but by https://sugarlabs.org/, therefore it is appropriate for this issue in Browse to remain closed. |
The Issue can be closed. Thanks! |
Thanks. I've had second thoughts. Could others please review what I've found;
--- /tmp/www/index.html.orig 2019-04-01 16:23:36.256210011 +1100
+++ /tmp/www/index.html 2019-04-01 16:24:09.271768336 +1100
@@ -112,12 +112,6 @@
var re = document.getElementById("SearchBar").value;
document.getElementById("searchLink").href = "/search/?q=" + re;
};
- document.addEventListener('keyup', function(ev) {
- if( ev.keyCode == 13 ) {
- var re = document.getElementById("SearchBar").value;
- document.getElementById("searchLink").href = "/search/?q=" + re;
- document.getElementById("searchLink").click();}
- });
function expander(){
if(window.innerWidth > 767){
document.getElementById("searchForm").style.width="53%"; This means that pressing enter in the URL entry box is executing JavaScript provided by the web page. How is it that the |
@quozl Thanks |
There's multiple files involved. I used index.html is the template source file from which the So it seems likely you have found the right file. |
But the file should not be changed. The fault is with Browse; it should not be forwarding key release events from the URL entry box to the WebView object. Other browsers don't do this. |
+1; Websites should not be able to take over the browser's expected behavior without asking for permissions |
@quozl @pro-panda @chimosky I did a lot of testing on the issue, but I'm unable to pinpoint the source of the issue exactly.
The link is not being redirected. I was able to verify this by printing out the status of the load operation in the I would really like some guidance on how to proceed. Thanks! |
Thanks for asking. Yes, that's the result of the JavaScript code on the web site being executed in response to the enter key release event. However, the problem is that the enter key release event should not have been handed over to the WebKit2.WebView widget. You could experiment with source code. WebView parent classes include Gtk.Container and Gtk.Widget, so you could capture the key-press-event signal. You could examine source code. WebView class is in the WebKit sources. The GTK widgets are in the GTK sources. However, it may be simpler to think about the problem entirely differently. Does it happen on other WebKit and GTK browsers? Yes, it does.
So instead of fixing it in Browse, we could log a bug to say that Epiphany (because of WebKit) can be prevented from doing a conventional search by redirecting the user to a crafted web page that contains a JavaScript key handler. This may be more serious than it looks! 😁 I suggest you search Epiphany or WebKit GTK bugs. Looking back, it was a mistake to assume that the problem is the fault of code in Browse, just because the issue was logged against Browse. p.s. this is still activity maintenance; we often have to fix or work around problems in other code than our own. |
Subject of the Issue
On visiting https://www.sugarlabs.org using Browse-activity and then using the Address bar if any keyword search is performed then the address redirects to website's search plugin instead of normal google search.
Test Environment
Steps to reproduce
Expected Behaviour
Actual Behaviour
The text was updated successfully, but these errors were encountered: