Guest User

Untitled

a guest
Jan 24th, 2019
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. // Para los que estamos hartos de abrir links de m.forocoches.com en un PC y que se vean optimizados para móvil.
  2. // 1. Instálate GreaseMonkey para tu navegador
  3. // 2. Crea un nuevo script. No se abre ninguna ventana. Se llama por defecto "Unnamed Script XXXXXX"
  4. // 3. Pega el siguiente código JS donde quieras:
  5.  
  6. var URL = window.location.href;
  7. var domain = document.domain;
  8. if (domain == 'm.forocoches.com'){
  9. window.location.href
  10. URL = URL.replace('/m.','/');
  11. window.location = URL;
  12. }
  13.  
  14. // Es extremadamente sencillo y hasta un mono podría entenderlo. Coge la URL y si es m.forocoches.com le elimina m. y te redirige.
  15. // Seguramente se pueda hacer mejor, lo iré mejorando.
  16. // Si ya existía algo así o tienes una sugerencia, escríbeme a @darlan256 en telegram.
Add Comment
Please, Sign In to add comment