Closed Bug 911150 Opened 11 years ago Closed 11 years ago

elpais.com mobile site opens blank tab on video start

Categories

(Web Compatibility :: Site Reports, defect)

Other
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: hsteen, Assigned: adamopenweb)

References

(Depends on 1 open bug, )

Details

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

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
Whiteboard: [country-es][clientsniff]
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.
Depends on: 911746
Whiteboard: [country-es][clientsniff] → [country-es][clientsniff][contactready]
I pinged my contacts, linking to this bug.
Harald any news about it?
Trying the marketing email marketing@elpais.es.
Assignee: nobody → astevenson
Status: NEW → ASSIGNED
Whiteboard: [country-es][clientsniff][contactready] → [country-es][clientsniff][sitewait]
Blocks: 827670
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");
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
Closed: 11 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Web Compatibility
Component: Mobile → Site Reports
You need to log in before you can comment on or make changes to this bug.