iris.to - Click background to back

You can click background to back at iris.to

目前为 2023-02-12 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name iris.to - Click background to back
  3. // @version 1.00
  4. // @grant none
  5. // @include https://iris.to/*
  6. // @description You can click background to back at iris.to
  7. // @license WTFPL
  8. // @namespace https://greasyfork.org/users/114367
  9. // ==/UserScript==
  10. addEventListener('click', e => {
  11. if (location.pathname === '/') return;
  12. if (!e.target.classList.contains('main-view')) return;
  13. if (document.getElementsByClassName('new-msg')[0]?.value) {
  14. if (!confirm('You are typing a note.\nAre you sure you want to go back?')) return;
  15. }
  16. history.back();
  17. });