elpais.com mobile site opens blank tab on video start

RESOLVED FIXED

Status

RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: hsteen, Assigned: adamopenweb)

Tracking

(Depends on: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [country-es][clientsniff][sitewait], URL)

Clicking/tapping the video to play it opens an empty tab.

JS apparently sets a target="_blank" attribute on a javascript: link that wraps the "view video" button:

http://ep01.epimg.net/m/js/comun.js

        if ('MozActivity' in window)  { // Firefox OS    
            activaBotonAtras();

            var enlaces = document.getElementsByTagName("a");
            var total_enlaces = enlaces.length;
            for ( i = 0 ; i < total_enlaces ; i++ ) {  // los enlaces que no son de EL PAÍS se tienen que abrir "fuera"
                if ( ! enlaces[i].getAttribute("href").match("/m/") ) 
                    enlaces[i].setAttribute("target","_blank"); 
                    else  
                    enlaces[i].setAttribute("target","_self"); 
            }


so tapping the video to start it makes the browser open a new tab for this javascript:void(0) URL:


	<a tabindex="20" target="_blank" class="posicionador" id="posicionador_1377758184_726257_1377857041" title="Ver vídeo" href="javascript:void(0)">
		<span class="boton_video"></span>

Related to bug 790893
(Reporter)

Updated

5 years ago
Whiteboard: [country-es][clientsniff]
(Reporter)

Comment 1

5 years ago
https://mobile.twitter.com/MozWebCompat/status/373416430324445184
not setting [sitewait] because I'm not sure how responsive they are on Twitter, it seems like quite a generic account.
(Reporter)

Updated

5 years ago
Depends on: 911746
(Reporter)

Updated

5 years ago
Whiteboard: [country-es][clientsniff] → [country-es][clientsniff][contactready]
I pinged my contacts, linking to this bug.
Harald any news about it?
(Assignee)

Comment 4

5 years ago
Trying the marketing email marketing@elpais.es.
Assignee: nobody → astevenson
Status: NEW → ASSIGNED
Whiteboard: [country-es][clientsniff][contactready] → [country-es][clientsniff][sitewait]
(Assignee)

Updated

5 years ago
Blocks: 827670
(Reporter)

Comment 5

5 years ago
suggestedfix
The simplest fix would be to find this code in the commun.js file:

  if ( ! enlaces[i].getAttribute("href").match("/m/") ) 
     enlaces[i].setAttribute("target","_blank"); 

The match() call is wrong because match() expects a regular expression, not a string.

El Pais developers should fix that and make sure it does not set the target attribute of javascript: links, for example by adding them to the matching. The correct version would be for example this:


  if ( ! enlaces[i].getAttribute("href").match(/(^javascript:|\/m\/)/) ) 
     enlaces[i].setAttribute("target","_blank");
(Reporter)

Comment 6

5 years ago
Harald, can we try going through your contacts again? Send them this link: http://webcompat.com/simplebug/?id=911150
Flags: needinfo?(hkirschner)
I will try to help you with this guys as i've been working on ELPAIS.com some years ago and i still have communications with some team-mates
Pinged the dev team again.
Flags: needinfo?(hkirschner)
Thanks to the elpais team it is fixed and live.
Tested on http://elpais.com/m/elpais/videos.html and working.
Thanks Harald.
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.