Skip to content

Instantly share code, notes, and snippets.

@qguv
Created October 9, 2022 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qguv/25cc00e8bead087ad2db165fbdf66c4e to your computer and use it in GitHub Desktop.
Save qguv/25cc00e8bead087ad2db165fbdf66c4e to your computer and use it in GitHub Desktop.
'Move to Inbox' in Basic HTML View in Gmail
// ==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