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

Modify selected urls with regex #409

Open
remi-garcia opened this issue Jan 4, 2022 · 3 comments
Open

Modify selected urls with regex #409

remi-garcia opened this issue Jan 4, 2022 · 3 comments

Comments

@remi-garcia
Copy link
Collaborator

See first workaround of #408

It could be useful to include a prefix, like a proxy, to every selected url. This should not be too much work as it only requires to modify a bit the code around

let links = Array.from(
new Set(
SelectedElements
.Links
.map(elem => elem.href)
)
);

and to include an option to set a prefix (leaving the option empty would do nothing: the current behavior)
See #303 for an idea on how to modify the options.

(@chaoscreater this might simplify just a bit your first workaround)

@cpriest
Copy link
Owner

cpriest commented Jan 4, 2022

So the trouble I have with adding this sort of feature is that it's a one-off use case. One that can easily be accomplished in any editor like VS Code.

  1. Paste the selected IP addresses
  2. Prefix each line with the preferred text (dozens of ways to do this fast and efficiently, I would use multiple carets or regex)

Essentially basic text manipulation. Adding this feature would add something I think would be a rarely used feature, which means nobody will know how to answer questions about it or they'll want some other 'tweak' to make it work just a little differently for their purpose.

I would support adding a general-purpose regex replace modify copied links with regex feature. It would take a smidgen more technical know-how to use it, but there are thousands of resources on the topic or I can easily answer those questions.

If you're familiar with PCRE (Perl RE), something like this would be the input in the field:
s#^#https://www.abuseipdb.com/check/# which translates to:

  • substitute
  • ^ each beginning of each line
  • ... with the URL

@chaoscreater
Copy link

Yes, it would be nice if we can have an option in the GUI to define a prefix.

At the moment, I'm hardcoding the prefix URL like this:
let links = Array.from(new Set(SelectedElements.Links.map((elem) => 'https://www.abuseipdb.com/check/' + elem.textContent)));

It would also be nice if we can add a suffix to the end as well.

I'm terrible with using regex, but I get the basics and I support this being implemented too. Any sort of basic text manipulation feature would be nice to have. I know I mentioned this in a separate post, but the lasso select feature is so nice and not many extensions do this, so it'll be kind a waste to limit this to only work for links and not text as well. I can see the potential of this extension able to lasso select text, manipulate text and do all kinds of things with it. At the moment, I'm having to combine multiple extensions to do what I want and it'll be nice if I don't have to use so many.

@remi-garcia remi-garcia changed the title Add a prefix to selected urls Modify selected urls with regex Jan 5, 2022
@cpriest
Copy link
Owner

cpriest commented Jan 5, 2022

Thanks @remi-garcia for all the ticket cleanup!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants