Block some specific resources in Network Panel across reloads
Categories
(DevTools :: Netmonitor, enhancement)
Tracking
(firefox68 fixed)
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: karlcow, Assigned: jryans)
References
(Blocks 3 open bugs)
Details
(Keywords: dev-doc-complete)
Attachments
(6 files)
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Note that we can:
- Block particular request
- Block domain or URL
- Block requests using glob pattern (*.js)
Honza
Comment 4•6 years ago
|
||
@Michal: do we have any platform API that would help us to implement this feature?
Honza
Updated•6 years ago
|
Assignee | ||
Comment 5•6 years ago
|
||
I'll make an attempt! 😄 Feel free to steal if I am taking too long...
Assignee | ||
Comment 6•6 years ago
|
||
Here's how I am currently displaying blocked requests.
Assignee | ||
Comment 7•6 years ago
|
||
It seems like we can just cancel requests from DevTools, so I don't think a platform API is required here.
Comment 8•6 years ago
|
||
It seems like we can just cancel requests from DevTools, so I don't think a platform API is required here.
I see ok.
Here's how I am currently displaying blocked requests.
The UI looks good to me!
Thanks!
Honza
Assignee | ||
Comment 9•6 years ago
|
||
Assignee | ||
Comment 10•6 years ago
|
||
This is a very basic form of request blocking for the Network Monitor. It only
supports blocking a request via right-click. This change adds the minimal UI and
server support to block the request.
There is no UI to indicate what happened to the request yet, so it will just
look like a "confused" request that never started. Future patches will improve
from here.
Assignee | ||
Comment 11•6 years ago
|
||
This updates the request list to indicate a request was blocked by marking the
entire request item and also replaces transferred size column with "blocked by
DevTools". In the future, we may show other reasons for blocking in this way,
such as CORS, etc.
Depends on D26579
Assignee | ||
Comment 12•6 years ago
|
||
This is nearly the same the first patch for blocking, but adds the unblock
option as well.
Depends on D26580
Assignee | ||
Comment 13•6 years ago
|
||
Depends on D26581
Assignee | ||
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
While this patch queue is correct code-wise, I'm wondering where we are going from this first iteration?
I've not found any followup bugs to know where we are going.
The feature is great, but is strictly limited to block resources one by one and via absolute URLs.
Also, there is no feedback when you do block a request.
It currently feels a bit broken because of that, we should have some UI to say that this request will be blocked.
Updated•6 years ago
|
Comment 17•6 years ago
|
||
Another follow up:
Bug 1543613 - Use DevTools specific blocking reason for manual resource blocking
We yet need a bug to cover the UI changes - I am waiting for Harald with this.
Honza
Comment 18•6 years ago
|
||
This is the UI Chrome is using:
Context menu actions:
- Block request URL
- Block request Domain
Honza
Assignee | ||
Comment 19•6 years ago
|
||
Hoping to investigate the headers issue that Alex spotted: https://phabricator.services.mozilla.com/D26582#789722.
Assignee | ||
Comment 20•6 years ago
|
||
Assignee | ||
Comment 22•6 years ago
|
||
Comment 23•6 years ago
|
||
@jryans: thanks for the update, I tested it and I can see the headers now.
I think it's ready to land.
The feature is great, but is strictly limited to block resources one by one and via absolute URLs.
Also, there is no feedback when you do block a request.
It currently feels a bit broken because of that, we should have some UI to say that this request will be blocked.
Yes agree, more work on the UI is needed, but it shouldn't block the patch provided here. The current minimal UI (actions in the context) menu works too.
Anyway, there are two follow ups:
- Bug 1545739 - Indicate that resources might be blocked
- Bug 1543613 - Use DevTools specific blocking reason for manual resource blocking
Thank you both Alex and Jryans for the help with this!
(I am also resolving NI for Harald since we discussed this offline)
Honza
Comment 24•6 years ago
|
||
Comment 25•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/eaf2a199d4ea
https://hg.mozilla.org/mozilla-central/rev/6b031fd49d1e
https://hg.mozilla.org/mozilla-central/rev/b9a2a553d0c4
https://hg.mozilla.org/mozilla-central/rev/6d168f63dd8d
Assignee | ||
Updated•6 years ago
|
Comment 26•6 years ago
|
||
Does this show in the UI? I just tried it in 68.0b6 and I see one possibly related menu item, "Block URL" so I tried it. The UI was not updated, and there didn't seem to be any blocking going on when I reloaded the page.
In Nightly, 69.0a1, I still only see one options, "Block URL" but the UI does change and display the blocked by DevTools message after I reload the page.
This bug says it was fixed in 68 but I can't to make the change in the Developer Edition, only in Nightly. Does this have to be turned on with a preference setting in 68 for now?
Comment 27•6 years ago
|
||
Irene, please see this section, it describes the feature in detail + provides screenshots:
https://docs.google.com/document/d/18sD1okBxWjMHLWYyUkStkcrwgWhb3NyN4n_eh1lqUGw/edit#heading=h.4jfv9i3xwir
If it doesn't work as explained in the doc, please file a bug.
Thanks,
Honza
Comment 28•6 years ago
|
||
That's wonderful. In Nightly it works exactly as you show in the doc, but I'm not seeing it work at all in the Developer version which is 68. The menu option is there but it has no effect. Should this be in a separate bug?
Comment 29•6 years ago
|
||
(In reply to Irene Smith from comment #28)
That's wonderful. In Nightly it works exactly as you show in the doc, but I'm not seeing it work at all in the Developer version which is 68. The menu option is there but it has no effect. Should this be in a separate bug?
There was regression that broke the feature in 68 and we fixed that in 69 - covered by bug 1554095
I just asked for uplift to 68 - if that happens the doc can target 68
Thanks for the pointer Irene!
Honza
Comment 30•6 years ago
|
||
Added documentation with images to the Network Monitor Filtering requests page because I felt that might be the easiest place to find it.
Also added this feature to Firefox 68 for developers
The Network monitor request list allows you to block a specific URL (bug 1151368).
Updated•6 years ago
|
Description
•