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)
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
Reporter | ||
Updated•11 years ago
|
URL: http://elpais.com/m/
Whiteboard: [country-es][clientsniff]
Reporter | ||
Comment 1•11 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•11 years ago
|
Whiteboard: [country-es][clientsniff] → [country-es][clientsniff][contactready]
Comment 2•11 years ago
|
||
I pinged my contacts, linking to this bug.
![]() |
||
Comment 3•11 years ago
|
||
Harald any news about it?
Assignee | ||
Comment 4•11 years ago
|
||
Trying the marketing email marketing@elpais.es.
Assignee: nobody → astevenson
Status: NEW → ASSIGNED
Whiteboard: [country-es][clientsniff][contactready] → [country-es][clientsniff][sitewait]
Reporter | ||
Comment 5•11 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•11 years ago
|
||
Harald, can we try going through your contacts again? Send them this link: http://webcompat.com/simplebug/?id=911150
Flags: needinfo?(hkirschner)
Comment 7•11 years ago
|
||
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
Comment 9•11 years ago
|
||
Thanks to the elpais team it is fixed and live.
![]() |
||
Comment 10•11 years ago
|
||
Tested on http://elpais.com/m/elpais/videos.html and working.
Thanks Harald.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Product: Tech Evangelism → Web Compatibility
Updated•11 months ago
|
Component: Mobile → Site Reports
You need to log in
before you can comment on or make changes to this bug.
Description
•