Greasy Fork 支持 简体中文。

formofavi

Force mobile facebook view

  1. // ==UserScript==
  2. // @name formofavi
  3. // @namespace null
  4. // @version 0.3
  5. // @description Force mobile facebook view
  6. // @author gidiigekau
  7. // @match https://*/*
  8. // @run-at document-start
  9. // ==/UserScript==
  10.  
  11. if (self === top && (/(?:www.facebook.com)/).test(document.location.href)) {
  12. var target = document.location.href.replace(/www.facebook/g, "m.facebook");
  13. window.location.replace(target);
  14. }
  15.  
  16. if (self === top && (/(?:https:\/\/m.facebook.com\/login\/\?next\=)/).test(document.location.href)) {
  17. var next = decodeURIComponent(document.location.href.split('?next=')[1]);
  18. window.location.replace(next);
  19. }