Closed Bug 1810344 Opened 2 years ago Closed 2 years ago

requestSize and responseSize is suddenly always zero in webRequest API

Categories

(WebExtensions :: Request Handling, defect)

Firefox 104
defect

Tracking

(firefox109 affected, firefox110 affected, firefox111 affected)

RESOLVED INCOMPLETE
Tracking Status
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

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.

Component: Untriaged → Request Handling
Product: Firefox → WebExtensions

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 !

Flags: needinfo?(yahiaghadiry)

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

Flags: needinfo?(yahiaghadiry)

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.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached image First_page_access.png

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.

ok I tried it with the same result

(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.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

Attached image testextension.png

as you can see in the attached file this is after few hours of usage only thing I get is size empty

Can you please find the regression range for this one Alex?

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.

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.

Can you please provide more details or a regression range please?

Flags: needinfo?(yahiaghadiry)

(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

Flags: needinfo?(yahiaghadiry)

Without enough info on how to reproduce, we can't do much here. Feel free to reopen if you can provide it.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE

FYI: This bug report was updated and filed again at bug 1815533.

See Also: → 1815533

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.

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

(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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: