Greasy Fork 还支持 简体中文。

Prod Detect

Displays a simple warning bar at the top of your site if you're on production.

  1. // ==UserScript==
  2. // @name Prod Detect
  3. // @namespace http://jordanbalagot.com/
  4. // @version 0.11
  5. // @description Displays a simple warning bar at the top of your site if you're on production.
  6. // @author Jordan B
  7. // @match http://www.google.com/*
  8. // ==/UserScript==
  9.  
  10. //Replace http://www.google.com/* with your production URL.
  11. if(window.location.href.indexOf("http://www.google.com/") > -1)
  12. {
  13. window.onload = function(){
  14. var proddiv = document.createElement("div");
  15. proddiv.id = "proddiv";
  16. proddiv.innerHTML = "PROD";
  17. document.body.appendChild(proddiv);
  18. var css = document.createElement("style");
  19. css.type = "text/css";
  20. css.innerHTML = "body { margin-top: 20px; } ";
  21. css.innerHTML += "#proddiv { position:absolute;text-align:left;top:0;width:100%;height:16px;opacity:1;z-index:100;background:red;color:white;padding:4px;}";
  22. document.body.appendChild(css);
  23. };
  24. }