Why does Opera Mini sometimes click the wrong link

4k views Asked by At

Every once in a while, but especially prevalent on Facebook, Opera Mini will exhibit the following behavior. Of two successive and different links, seperated by text and other markup:

  1. the correct link will highlight on hover,
  2. when clicked, no other flashing/highlighting occurs, but
  3. it loads the second (incorrect) link, or some other link altogether.

In a related but not identical question1, it was suggested that it's either the same link, the same bound javascript event, or an unclosed a tag. I am almost entirely sure it's not the first or last, but may be the js issue if it's nothing else. But, as I can't test in this environment, I'm asking the community, which maybe has experience here. Thanks!

1Oddly enough, this bug/issue cropped up while navigating suggested answers for this question (after clicking on listed question and hitting 'back', on clicking the second possible listed question, it returned me to the question page without any suggested links showing). I can't go back to check without losing this page, though, so will have to try to search out the question and link it here later.

2

There are 2 answers

2
tagawa On BEST ANSWER

I don't use Facebook but I did get the same thing as you when trying to ask a Stackoverflow question and clicking on related links. The links are generated dynamically by pulling in an external list of search results. For example: https://stackoverflow.com/search/titles?like=why+does+opera+mini+sometimes+click+the+wrong+link

As you probably know, Opera Mini renders JavaScript on the server. When the "ask a question" page loads the related links script is executed but when you go back to the same page, the script doesn't execute a second time. Only the cached page is displayed which can affect dynamically generated content and scripts.

In addition, to avoid rogue scripts running for too long and potentially crashing the Opera Mini servers, scripts on a page are only run for a couple of seconds so any links generated after this time will not appear or behave as they should. Here's some more info about Opera Mini's JavaScript behaviour: http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#javascript

0
hexalys On

I would think that may had or has to do with a z-index position bad behavior in Opera Mini.

I have encountered a very bad example of this. On one of my newest sites, I happen to render the navigation menu on a lower z-index, in fixed positions below the page content. And the menu is revealed by clicking on the hamburger button's :focus trigger on an input type="checkbox".

What happened is that the entire vertical menu and its links behind the page content, were being exposed to being clickable, along all the actually visible links elements on a higher z-index.

I had to add visibility: hidden; to the navigation menu in input:not(:checked) context so that all the navigation links become clickable only when the navigation menu is revealed.

So my guess here, is that Opera Mini may treat displayed links as visibility: visible; as actionable clickable elements regardless of the actual visibility status of the z-index there are in.