Mobile MobileRead.com

This userscript injects mobile detection to MobileRead.com

  1. // ==UserScript==
  2. // @name Mobile MobileRead.com
  3. // @name:pl Mobilny MobileRead.com
  4. // @namespace Violentmonkey Scripts
  5. // @match https://www.mobileread.com/*
  6. // @grant none
  7. // @version 1.2
  8. // @author juliazero
  9. // @license GPL-3.0-only
  10. // @description This userscript injects mobile detection to MobileRead.com
  11. // @description:pl Ten skrypt wgrywa detekcję mobilnych rządzeń dla MobileRead.com
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. var headElement = document.head || document.getElementsByTagName('head')[0];
  17. var metaElement = document.createElement('meta');
  18. metaElement.name = 'viewport';
  19. metaElement.content = 'width=device-width,initial-scale=1,maximum-scale=1,user-scalable=yes';
  20. if (headElement) {
  21. headElement.appendChild(metaElement);
  22. } else {
  23. console.error('Cannot find element <head>.');
  24. }
  25. let css = `
  26. /* Paste MobileRead.com Dark UserCSS here if you dont want use Stylus extension. */
  27. `
  28. let style = document.createElement("style");
  29. style.innerText = css;
  30. document.head.appendChild(style);
  31. })();