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

Filter HTTP method (GET, POST...) #2117

Closed
8 tasks done
eggBoth opened this issue May 21, 2022 · 10 comments
Closed
8 tasks done

Filter HTTP method (GET, POST...) #2117

eggBoth opened this issue May 21, 2022 · 10 comments
Labels
enhancement New feature or request fixed issue has been addressed

Comments

@eggBoth
Copy link

eggBoth commented May 21, 2022

Prerequisites

I tried to reproduce the issue when...

  • uBO is the only extension
  • uBO with default lists/settings
  • using a new, unmodified browser profile

Description

Implement filtering of network requests by HTTP method.

A specific URL where the issue occurs

Steps to Reproduce

||www.example.com^$method=post

Expected behavior

Should block any request to www.example.com that uses the HTTP method POST.

Actual behavior

Does not block.

uBlock Origin version

1.42.4

Browser name and version

Operating System and version

@krystian3w
Copy link

Maybe possible use to disable redirect with forms on phishing pages...

@gwarser
Copy link

gwarser commented May 22, 2022

You will need to provide real world use case for this.

@gwarser gwarser closed this as completed May 22, 2022
@gwarser gwarser added invalid not a uBlock issue enhancement New feature or request labels May 22, 2022
@gorhill gorhill reopened this Jun 3, 2022
@gorhill gorhill removed the invalid not a uBlock issue label Jun 3, 2022
@gorhill
Copy link
Member

gorhill commented Jun 3, 2022

Even though no concrete cases has been provided, I will consider implementing this just for the sake of being on par with the declarativeNetRequest API which supports filtering on request method: https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#type-RequestMethod.

@eggBoth
Copy link
Author

eggBoth commented Jun 3, 2022

@gorhill Thank you.

@qo4on

This comment was marked as off-topic.

@uBlockOrigin uBlockOrigin locked as off-topic and limited conversation to collaborators Jul 31, 2022
@uBlockOrigin uBlockOrigin unlocked this conversation Dec 23, 2022
troysjanda pushed a commit to troysjanda/uBlock that referenced this issue Dec 23, 2022
Related issue:
- uBlockOrigin/uBlock-issues#2117

Option: `method=`
Value: a list of `|`-separated lowercased method names. Negated
method names are allowed. These are valid methods:

- connect
- delete
- get
- head
- options
- patch
- post
- put

As per DNR's own documentation:
- https://developer.chrome.com/docs/extensions/reference/declarativeNetRequest/#type-RequestMethod

The logger shows the method used for every network request. It's
possible to filter the logger output for most-common methods: `get`,
`head`, `post`.
@uBlock-user
Copy link
Contributor

With gorhill/uBlock@b698187

Now if you add ||google.com^$method=post and go to google.com
you will end up with this --

Capture

gorhill added a commit to gorhill/uBlock that referenced this issue Dec 24, 2022
@uBlock-user uBlock-user added the fixed issue has been addressed label Dec 24, 2022
@MasterKia
Copy link
Member

https://github.com/uBlockOrigin/uBlock-issues/wiki/Static-filter-syntax#method

@MasterKia
Copy link
Member

The logger doesn't highlight invalid methods.
Screenshot_20230213_184052

Version: 1.46.1rc0

@uBlock-user
Copy link
Contributor

@MasterKia Need to implement a whitelist of all valid methods, like gorhill did for pseudoclasses/selectors.

@krystian3w
Copy link

And share as fork of uBo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

7 participants