Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Facebook tracking from copied links #1169

Merged
merged 6 commits into from Nov 12, 2019
Merged

Remove Facebook tracking from copied links #1169

merged 6 commits into from Nov 12, 2019

Conversation

jaflo
Copy link
Contributor

@jaflo jaflo commented Nov 7, 2019

This fixes #248 and fixes #286. The actual code to clean the URL is copied from PR #226 (same functionality for clicked links). As mentioned in the linked issues, this makes use of code changes in sindresorhus/electron-context-menu#44.

Ideally the menu item would be replaced in a neater way, but that requires upstream changes. For now, this code change takes advantage of the fact that the default menu items can be exposed through the prepend function and then the transform functionality is used to change the URL as needed.

I considered two ways to change the functionality: use of the menu option or some new functionality in the library that replaces default menu items. The first approach cannot be done because we cannot read the default list of menu items, so we would need to duplicate code. Even if that is done, the type definition for Actions has no copyLink. The second approach is cleaner: some new functionality that allows for replacement of default items. I think that this should be possible once sindresorhus/electron-context-menu#70 is addressed.

A summary of these issues has been put in place while this hacky solution is used.

source/index.ts Outdated Show resolved Hide resolved
source/index.ts Outdated Show resolved Hide resolved
source/index.ts Outdated Show resolved Hide resolved
@jaflo jaflo changed the base branch from master to 2.34 November 8, 2019 21:38
@jaflo jaflo changed the base branch from 2.34 to master November 8, 2019 21:38
source/util.ts Outdated Show resolved Hide resolved
source/util.ts Outdated Show resolved Hide resolved
@sindresorhus sindresorhus merged commit 74416e6 into sindresorhus:master Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite urls to remove Facebook's redirect Block Facebook link tracking when "Copy link" chosen
2 participants