Created
October 9, 2022 16:03
-
-
Save qguv/25cc00e8bead087ad2db165fbdf66c4e to your computer and use it in GitHub Desktop.
'Move to Inbox' in Basic HTML View in Gmail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 'Move to Inbox' in Basic HTML View in Gmail | |
// @namespace https://quint.guvernator.net | |
// @version 0.1 | |
// @description add an option to move emails to the inbox in the basic HTML view of Gmail | |
// @author qguv | |
// @match https://mail.google.com/mail/u/*/h/*/?*&s=* | |
// @exclude https://mail.google.com/mail/u/*/h/*/?*&s=i* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const exclusions = [ | |
'input[type="submit"][name="nvp_a_ib"]', | |
'option[value="ib"]', | |
]; | |
if (exclusions.some(document.querySelector)) { | |
return; | |
} | |
const move_to_inbox = document.createElement('option'); | |
move_to_inbox.value = 'ib'; | |
move_to_inbox.innerHTML = '→ Inbox'; | |
const more_actions = document.querySelector('select[name="tact"]'); | |
more_actions.children[0].after(move_to_inbox); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment