Index: trunk/extensions/WikimediaMobile/MobileRedirect.js |
— | — | @@ -8,12 +8,10 @@ |
9 | 9 | if ( /(iPhone|iPod|Android.*Mobile|webOS|NetFront|Opera Mini|SEMC-Browser|PlayStation Portable|Nintendo Wii|BlackBerry)/ |
10 | 10 | .test( navigator.userAgent ) ) |
11 | 11 | { |
12 | | - |
13 | 12 | if ( (document.cookie.indexOf("irect=t") < 0) // Don't redirect if we have the stop cookie ... only testing a subportion of the cookie. Should be REALLY unique! |
14 | | - && (wgNamespaceNumber >= 0) // Don't redirect special pages |
15 | | - && (wgAction == "view")) // Don't redirect URLs that aren't simple page views |
| 13 | + && (!document.getElementsByClassName || document.getElementsByClassName( 'ns--1' ).length == 0) |
| 14 | + && (document.location.href.indexOf( 'action=' ) == -1 || document.location.href.indexOf( 'action=view' ) != -1 )) // Don't redirect URLs that aren't simple page views |
16 | 15 | { |
17 | | - |
18 | 16 | // If we've made it here, then we are going ahead with the redirect |
19 | 17 | |
20 | 18 | // If we are NOT on the main page, then set the pageName! |