gmail_filter

gmail filter page work break

  1. // ==UserScript==
  2. // @name gmail_filter
  3. // @namespace https://mesak.tw
  4. // @version 0.1
  5. // @description gmail filter page work break
  6. // @author Mesak
  7. // @license MIT
  8. // @match https://mail.google.com/mail/u/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
  10. // @grant GM_addStyle
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. GM_addStyle(`
  16. .wbba {word-break: break-all;}
  17. `);
  18. window.addEventListener('popstate', (event) => {
  19. const url = new URL(document.location);
  20. if( url.hash == '#settings/filters'){
  21. const mainBody = document.querySelector('div[role="main"]');
  22. buildEvent(mainBody)
  23. }
  24. });
  25. function buildEvent( body ){
  26. for(let span of body.querySelectorAll('tr[role="listitem"] > td:nth-child(2) > span') ){
  27. span.classList.add("wbba");
  28. }
  29. }
  30. })();