Skip to content

A Chrome extension that automatically inserts a random signature from your saved Gmail signatures when composing a new email.

License

Notifications You must be signed in to change notification settings

joedevon/gmail-signature-rotator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gmail Signature Rotator

A Chrome extension that automatically inserts a random signature from your saved Gmail signatures when composing a new email.

⚠️ Important Note

This is a fun, personal chrome extension created through vibe coding (AI-assisted development). While functional, at least it works for me, it does have some limitations:

  • Multiple Windows Issue: When multiple compose windows are open simultaneously, the extension will overwrite signatures in previously opened windows. For best results, compose emails one at a time, and give the extension a moment to load.
  • Code Quality: This is an experimental project meant to demonstrate vibe coding, not production-grade code. Feel free to use it, but consider it a starting point rather than a best practice example.

Overview

Gmail Signature Rotator adds serendipity to your email communications by randomly selecting one of your pre-configured Gmail signatures each time you compose a new message. This extension is perfect for anyone who wants to promote different content (like podcast episodes), share various contact methods, or simply add an element of surprise to their email communications.

About the Author & Project

I'm primarily a database guy who spent a decade running a dev shop. While I've been programming since I was 13, my JavaScript skills are admittedly rusty. This project represents a fun experiment in using AI to quickly solve a personal need - I wanted to promote different podcast episodes in my email signatures.

This extension is:

  • ✅ Perfect for personal use
  • ✅ A fun example of vibe coding
  • ✅ Suitable for learning and experimentation
  • ❌ Not robust enough to be released as a Chrome extension in production
  • ❌ Not an example of best practices

The Story Behind This Project

I created this extension through vibe coding - a process where AI tools generate the entire codebase with minimal human intervention or code review, valued primarily for its speed at solving small problems or trying fun experiments.

I got bored with using the same email signature all the time and wanted to add some serendipity to my emails. As someone who hosts a podcast, I thought it would be cool to rotate through signatures containing links to different podcast episodes.

About Vibe Coding

While vibe coding is a fun and fast way to produce functional solutions for simple problems, the approach prioritizes speed and convenience over traditional development practices. It can present a significant security risk in the hands of a beginner.

AI-generated code may inadvertently include sensitive information like API keys directly in the codebase. Without proper review, these exposures have led some people to incur thousands of dollars in unauthorized charges. The code often lacks proper security practices that an experienced developer would implement.

I have the background to evaluate and fix security issues in AI-generated code. Without similar experience, it's difficult to identify potential vulnerabilities.

Vibe coding can be a wonderful learning tool for beginners when used in controlled environments. The approach works best for personal projects on your own machine. For projects that will be shared publicly, additional security review is essential.

If you're experimenting with this approach, as a programmer to review the code for you. At the very least, open a brand new chat window, and prompt your favorite AI to review the code for you. For more context on the potential pitfalls, check out this cautionary video.

Features

  • Automatically detects when you open a new compose window
  • Finds and clicks the signature button
  • Randomly selects one of your existing signatures (excluding "No signature" and "Manage signatures" options)
  • Works with Gmail's web interface

Installation

  1. Clone this repository or download the source code
  2. Open Chrome and navigate to chrome://extensions/
  3. Enable "Developer mode" in the top right
  4. Click "Load unpacked" and select the directory containing the extension files

Usage

  1. Make sure you have at least one signature saved in Gmail settings
  2. Simply compose a new email - the extension will automatically insert a random signature
  3. If you don't want a signature for a particular email, you can manually remove it or select "No signature"

Signature Management

By default, the extension ignores certain signatures. These are configured in the CONFIG.IGNORED_SIGNATURES array in content.js:

IGNORED_SIGNATURES: ['Manage signatures', 'No signature']

Best Practices for Signatures

  • Use simple names without special characters
  • Avoid using names that match the ignored signatures
  • Keep signature names unique and descriptive

To add more signatures to ignore:

  1. Open content.js
  2. Locate the CONFIG object at the top
  3. Add your signature name to the IGNORED_SIGNATURES array
  4. Example: IGNORED_SIGNATURES: ['Manage signatures', 'No signature', 'Draft Signature']

Technical Details

The extension uses:

  • Manifest V3
  • MutationObserver to detect new compose windows
  • DOM manipulation to find and interact with Gmail's signature UI
  • Asynchronous operations to handle Gmail's dynamic interface

Configuration Options

The extension can be customized by modifying the CONFIG object in content.js:

const CONFIG = {
    // Debug mode - set to false in production
    DEBUG: false,                       // Enable/disable debug logging

    // Wait time after compose window detection (ms)
    COMPOSE_WINDOW_LOAD_DELAY: 1000,    // Increase if extension misses signature button
    
    // Wait time after clicking signature button (ms)
    SIGNATURE_MENU_DELAY: 500,          // Increase if menu items aren't found
    
    // Maximum number of processed window IDs to remember
    MAX_PROCESSED_WINDOWS: 100,         // Decrease if memory usage is a concern
    
    // Signatures to exclude from random selection
    IGNORED_SIGNATURES: ['Manage signatures', 'No signature']
};

If the extension isn't working reliably, try increasing the delay values. On slower connections, you might need to double them.

Debug Mode

The extension includes a debug mode that can be enabled by setting CONFIG.DEBUG = true in content.js. When enabled, it will output detailed logs to the console about:

  • Extension initialization
  • Compose window detection
  • Signature button and menu interactions
  • Selected signatures

This is useful for troubleshooting if the extension isn't working as expected.

Contributing

Pull requests are welcome! While this started as a vibe coding experiment, we're happy to evolve it into something more robust with community help.

License

MIT License

Credits

Created by Joe Devon.

Follow Me

Check out my podcast on Accessibility and Gen. AI.

Subscribe to my LinkedIn newsletter to get updates on my projects and articles.

Follow me on socials at @joedevon.

About

A Chrome extension that automatically inserts a random signature from your saved Gmail signatures when composing a new email.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published