Hi Bob,
I’d be happy to help you with your Chrome extension to disable the Gmail compose button while allowing replies. Below is a solution you can implement:
Solution Overview
You’ll need to create a simple Chrome extension that uses JavaScript to hide or disable the Gmail compose button. Here’s how to do it:
1. Create the Extension Files
Your extension will need:
A manifest.json file (required for all Chrome extensions).
A content.js file to manipulate the Gmail DOM.
2. Folder Structure
3. Code Implementation
A. manifest.json
B. content.js
Run the function when the page loads and on DOM changes (Gmail is dynamic)
document.addEventListener('DOMContentLoaded', hideComposeButton);
const observer = new MutationObserver(hideComposeButton);
observer.observe(document.body, { childList: true, subtree: true });
4. Load the Extension in Chrome
1. Go to chrome://extensions/.
2. Enable Developer mode (toggle in the top-right).
3. Click Load unpacked and select your extension folder.
How It Works
The extension injects content.js into Gmail.
It hides the compose button by targeting its [gh="cm"] attribute (Gmail’s internal identifier).
A MutationObserver ensures the button stays hidden even if Gmail dynamically reloads the UI.
Notes & Limitations:
This hides the button but doesn’t prevent keyboard shortcuts (e.g., `c` for compose). To block those, you’d need additional logic.
If Gmail’s DOM structure changes, the selector (`[gh="cm"]`) may need updating.
Let me know if you need further adjustments or enhancements!
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-script-community/f20664f1-5aff-40d0-93d5-928b1fefe827n%40googlegroups.com.
Bob Bryan
Information Systems Consultant
bbr...@garlandcountyhabitat.org
240 Hobson Avenue | Hot Springs, AR 71913
Telephone 501-623-5600 M 480-299-1767

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-script-community/f20664f1-5aff-40d0-93d5-928b1fefe827n%40googlegroups.com.