requestSize and responseSize is suddenly always zero in webRequest API
Categories
(WebExtensions :: Request Handling, defect)
Tracking
(firefox109 affected, firefox110 affected, firefox111 affected)
People
(Reporter: yahiaghadiry, Unassigned)
References
Details
(Keywords: regressionwindow-wanted)
Attachments
(4 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0
Steps to reproduce:
while using webrequest.onComplete event listener a month ago, it would normally give a value to requestSize and responseSize if it isn't cached, but for some reason after using the same API today, it only gives zero values.
Actual results:
both always have a value of zero
Expected results:
both should have normal values and not always zeros
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'WebExtensions::Request Handling' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 years ago
•
|
||
Hello yahiaghadiry,
I’m from WebExtensions QA and I’m attempting to reproduce the issue in order to confirm it.
However, I’m having trouble with understanding what steps to follow in order to do so, though.
Would you be able to provide some more detailed steps on how to reproduce the issue and maybe attach a test extension?
Thank you !
Reporter | ||
Comment 3•2 years ago
|
||
okay here iI have kept only things that matter here (for some reason I can't just attach a file) :
background.js
async function printData(requestDetails) {
if (requestDetails.requestSize != 0 || requestDetails.responseSize != 0)
{
console.log("Size not empty", requestDetails);
}
else
{
console.log("Size empty");
}
}
browser.webRequest.onCompleted.addListener(
(requestDetails) => {
printData(requestDetails).then();
}, {
urls: ["<all_urls>"]
}, ["responseHeaders"]
);
manifest.json
{
"manifest_version": 2,
"name": "test",
"version": "1",
"homepage_url":"https://test.test",
"description": "",
"background":
{
"scripts": ["background.js"]
},
"permissions": [
"storage",
"unlimitedStorage",
"webRequest",
"<all_urls>"
]
}
Normal output should
Size not empty requestDetails
Actual output is only
Size empty
Comment 4•2 years ago
|
||
Thank you for the test extension !
I reproduced the issue on the latest Nightly (111.0a1/20230117161302), Beta (110.0b2/20230117185909) and Release (109.0/20230112150232) under Windows 10 x64 and Ubuntu 16.04 LTS.
Upon loading the extension via about:debugging and then accessing https://www.wikipedia.org/, for example, for the first time, the extension console will log only “Size not empty” followed by the requestDetails.
Accessing the website a second time or reloading the page will log one “Size not empty” with requestDetails and multiple “Size empty” with no requestDetails.
For further details, see the attached screenshots.
Comment 5•2 years ago
|
||
Comment 6•2 years ago
|
||
Reporter | ||
Comment 7•2 years ago
|
||
I think this is the typical behaviour since on the first time it loads the data from the web but on the second time it loads it from cached data
but for me on the first load, it shows size not empty.
maybe it's something to do with cached data I will try to erase it now and see what happens.
Reporter | ||
Comment 8•2 years ago
|
||
ok I tried it with the same result
Reporter | ||
Comment 9•2 years ago
|
||
(In reply to yahiaghadiry@gmail.com from comment #3)
okay here iI have kept only things that matter here (for some reason I can't just attach a file) :
background.jsasync function printData(requestDetails) { if (requestDetails.requestSize != 0 || requestDetails.responseSize != 0) { console.log("Size not empty", requestDetails); } else { console.log("Size empty"); } } browser.webRequest.onCompleted.addListener( (requestDetails) => { printData(requestDetails).then(); }, { urls: ["<all_urls>"] }, ["responseHeaders"] );
manifest.json
{ "manifest_version": 2, "name": "test", "version": "1", "homepage_url":"https://test.test", "description": "", "background": { "scripts": ["background.js"] }, "permissions": [ "storage", "unlimitedStorage", "webRequest", "<all_urls>" ] }
Normal output should
Size not empty requestDetails
Actual output is only
Size empty
Reporter | ||
Comment 10•2 years ago
|
||
Reporter | ||
Comment 11•2 years ago
|
||
as you can see in the attached file this is after few hours of usage only thing I get is size empty
Comment 12•2 years ago
|
||
Can you please find the regression range for this one Alex?
Comment hidden (obsolete) |
Comment 14•2 years ago
|
||
I’m not sure I can provide a better regression window from the one in Comment 13, as I’m having trouble reproducing the issue as per the claims of the reporter.
Initially, when I set the issue to New, I checked the extension console for the “size empty” entry, which on first page load does not get logged on my end. Only a reload of the page will trigger the logging of the “size empty” entry which according to Comment 7, might be the expected behavior. Meaning my initial approach might have been wrong.
In the case of the reporter, the “size empty” entry is logged on first page load and not a page reload or a second accessing of the page as in my case and as such I cannot provide an accurate regression window.
Comment 15•2 years ago
|
||
I’m so sorry, somehow I commented on a completely incorrect bug. 🙇♂️ My regression window is for something else. If possible, please remove/hide the comment to avoid confusion.
Comment 16•2 years ago
|
||
Can you please provide more details or a regression range please?
Reporter | ||
Comment 17•2 years ago
|
||
(In reply to Tomislav Jovanovic :zombie from comment #16)
Can you please provide more details or a regression range please?
I am not sure How I can do that
Comment 18•2 years ago
|
||
Without enough info on how to reproduce, we can't do much here. Feel free to reopen if you can provide it.
Comment 19•2 years ago
|
||
FYI: This bug report was updated and filed again at bug 1815533.
Reporter | ||
Comment 20•2 years ago
|
||
I just found out that U block origin was causing this issue as soon as I disabled it everything worked as it did before, it should have been my first step to solving this bug, thanks for the support and sorry for wasting yout time.
Comment 21•2 years ago
|
||
This is not a bug with uBlock Origin, even though it can trigger the issue. We reproduced the issue at the other bug, at https://bugzilla.mozilla.org/show_bug.cgi?id=1815533#c9
Reporter | ||
Comment 22•2 years ago
|
||
(In reply to Rob Wu [:robwu] from comment #21)
This is not a bug with uBlock Origin, even though it can trigger the issue. We reproduced the issue at the other bug, at https://bugzilla.mozilla.org/show_bug.cgi?id=1815533#c9
ok, Many thanks.
Description
•