Image viewer

Image viewer for Firefox

当前为 2016-04-06 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Image viewer
  3. // @namespace http://devs.forumvi.com/
  4. // @description Image viewer for Firefox
  5. // @version 1.0.3
  6. // @icon http://i.imgur.com/ItcjCPc.png
  7. // @author Zzbaivong
  8. // @match *
  9. // @noframes
  10. // @supportURL https://github.com/baivong/Userscript/issues
  11. // @run-at document-end
  12. // @grant GM_addStyle
  13. // ==/UserScript==
  14. (function () {
  15. var theme = 'light'; // dark|light
  16. var url;
  17. if (theme === 'light') {
  18. url = 'data:image/gif;base64,R0lGODlhCgAKAIAAAAAAAP///yH5BAEAAAAALAAAAAAKAAoAAAIRhB2ZhxoM3GMSykqd1VltzxQAOw==';
  19. } else {
  20. url = 'data:image/gif;base64,R0lGODlhCgAKAPAAACIiIgAAACH5BAHoAwEALAAAAAAKAAoAAAIRjA2Zhwoc3GMSykqd1VltzxQAOw==';
  21. }
  22. if (document.contentType.indexOf('image/') === 0) {
  23. GM_addStyle('body{background:url(' + url + ') repeat scroll rgba(0, 0, 0, 0.3);}body > img {background-color: transparent !important;}body > img:hover {background: rgba(0, 0, 0, 0.4) !important; outline: 3px solid #333;}');
  24. }
  25. }());