Stop the unsubscribe guard from blocking every real signature - #10
Merged
Merged
Conversation
The extension found the signature and then refused to delete it. Reported from a live Gmail compose window: loaded, enabled, correct selector, nothing removed. removeBlock() skipped any block whose text matched /unsubscribe|opt.out|.../ when keepUnsubscribe was on, which is the default. Signature variants 17 and 18 both render an "Unsubscribe" or "Opt out" link into every ordinary email, so the text match fired on essentially every signature Mailsuite produces. The guard meant to protect bulk mail was quietly disabling the entire extension. Captured markup from the live compose window shows why the text was never the right thing to look at: <a href="https://##mt_unsubscribe_link##">Opt out</a> That href is the unsubstituted campaign placeholder. Mailsuite only fills it in when a Campaign actually goes out, so on a one-to-one email it is a dead link wearing the word "Opt out". hasLiveUnsubscribe() now checks whether the link goes anywhere: an anchor with the placeholder href is ignored, a real unsubscribe URL still protects the block. Campaign mail keeps its legally required link, ordinary mail loses the advert. Three tests from the captured DOM, verbatim including the timestamp cell and the Remove button: the live v18 signature is removed under default settings, the placeholder is not mistaken for a live link, and a substituted real unsubscribe URL is still kept. 19 tests, all passing. Version 0.2.1. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013rTepGiDUe15iPn6XqmKjy
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: stop the unsubscribe guard from blocking every real signature
The extension found the signature and then refused to delete it. Reported from
a live Gmail compose window: loaded, enabled, correct selector, nothing removed.
removeBlock() skipped any block whose text matched /unsubscribe|opt.out|.../
when keepUnsubscribe was on, which is the default. Signature variants 17 and 18
both render an "Unsubscribe" or "Opt out" link into every ordinary email, so the
text match fired on essentially every signature Mailsuite produces. The guard
meant to protect bulk mail was quietly disabling the entire extension.
Captured markup from the live compose window shows why the text was never the
right thing to look at:
Opt out
That href is the unsubstituted campaign placeholder. Mailsuite only fills it in
when a Campaign actually goes out, so on a one-to-one email it is a dead link
wearing the word "Opt out".
hasLiveUnsubscribe() now checks whether the link goes anywhere: an anchor with
the placeholder href is ignored, a real unsubscribe URL still protects the
block. Campaign mail keeps its legally required link, ordinary mail loses the
advert.
Three tests from the captured DOM, verbatim including the timestamp cell and the
Remove button: the live v18 signature is removed under default settings, the
placeholder is not mistaken for a live link, and a substituted real unsubscribe
URL is still kept.
19 tests, all passing. Version 0.2.1.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_013rTepGiDUe15iPn6XqmKjy