You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
In Firefox Nightly, "NS_ERROR_XPC_NOT_ENOUGH_ARGS: Not enough arguments [nsICookieManager2.remove] HTTPS.js:164:0" #4241
changed the title [-]In Firefox NIghtly, "NS_ERROR_XPC_NOT_ENOUGH_ARGS: Not enough arguments [nsICookieManager2.remove] HTTPS.js:164:0"[/-][+]In Firefox Nightly, "NS_ERROR_XPC_NOT_ENOUGH_ARGS: Not enough arguments [nsICookieManager2.remove] HTTPS.js:164:0"[/+]on Feb 29, 2016
(Of course, that change on its own would make HTTPS Everywhere stop working in earlier versions of Firefox, like our current release & beta. So really, I suspect they might want to do this in a try{}catch{}, or something else to allow for both versions of the method.)
the new method wants an additional param. Change that line to:
cookieManager.remove(c.host, c.name, c.path, c.originAttributes, false);
No, this doesnt work, changing that in HTTPS.js only cause this error to appear.
NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsICookieManager2.remove] HTTPS.js:164
They changed it so that origin attributes is the last parameter. It appeared as the fourth parameter in an initial incarnation in nightly, but that just broke too many addons, so it was moved after the existing parameters. It is also optional, although the documentation doesn't say that and it is likely to become mandatory at some point. The console message should only appear if the origin attributes parameter (the fifth one) is undefined or empty.
OK, I think this issue can just be closed then -- it was addressed/worked-around by that ^^ Firefox bug.
(As a sanity-check that this is indeed fixed: I don't see any mentions of NS_ERROR_XPC_NOT_ENOUGH_ARGS in my error console, in my current Firefox session which has HTTPS Everywhere active.)
Ah, I guess I must not have exercised HTTPS Everywhere sufficiently in that browser-session.
@bakulf , are those warnings expected? If not, we should figure out what's causing them... Or if they are indeed expected, then we should indeed get this fixed in HTTPS Everywhere.
Those warnings are expected if OriginAttributes is not passed as argument, yes. I was commenting the title of the bug, and nsICookieManager.remove() doesn't throw NS_ERROR_XPC_NOT_ENOUGH_ARGS anymore, so this issue it's fixed.
I'm going to send a pull-request for this issue, but we should file a new for supporting originAttributes correctly. This means: privateBrowsing(?), WebExtensions and containers, these 3 features (and maybe in the future we could have more) are currently managed via OriginAttributes.
Activity
[-]In Firefox NIghtly, "NS_ERROR_XPC_NOT_ENOUGH_ARGS: Not enough arguments [nsICookieManager2.remove] HTTPS.js:164:0"[/-][+]In Firefox Nightly, "NS_ERROR_XPC_NOT_ENOUGH_ARGS: Not enough arguments [nsICookieManager2.remove] HTTPS.js:164:0"[/+]dholbert commentedon Feb 29, 2016
(CCing @bakulf who made this change in Gecko.)
bakulf commentedon Mar 1, 2016
the new method wants an additional param. Change that line to:
cookieManager.remove(c.host, c.name, c.path, c.originAttributes, false);
dholbert commentedon Mar 1, 2016
(Of course, that change on its own would make HTTPS Everywhere stop working in earlier versions of Firefox, like our current release & beta. So really, I suspect they might want to do this in a try{}catch{}, or something else to allow for both versions of the method.)
Vednier commentedon Jun 30, 2016
Right now Nightly (Firefox 50) throws a lot of errors like this in console
“nsICookieManager.remove()” is changed. Update your code and pass the correct originAttributes. Read more on MDN: https://developer.mozilla.org/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICookieManager HTTPS.js:164:6
“nsICookieManager2.add()” is changed. Update your code and pass the correct originAttributes. Read more on MDN: https://developer.mozilla.org/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICookieManager2 HTTPS.js:165:6
Vednier commentedon Jun 30, 2016
No, this doesnt work, changing that in HTTPS.js only cause this error to appear.
NS_ERROR_ILLEGAL_VALUE: Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsICookieManager2.remove] HTTPS.js:164
Lithopsian commentedon Jul 11, 2016
They changed it so that origin attributes is the last parameter. It appeared as the fourth parameter in an initial incarnation in nightly, but that just broke too many addons, so it was moved after the existing parameters. It is also optional, although the documentation doesn't say that and it is likely to become mandatory at some point. The console message should only appear if the origin attributes parameter (the fifth one) is undefined or empty.
Vednier commentedon Jul 27, 2016
Changing lines 164 and 165 from
cookieManager.remove(c.host, c.name, c.path, false); cookieManager.add(c.host, c.path, c.name, c.value, true, c.isHTTPOnly, c.isSession, expiry);to
cookieManager.remove(c.host, c.name, c.path, false, c.originAttributes); cookieManager.add(c.host, c.path, c.name, c.value, true, c.isHTTPOnly, c.isSession, expiry, c.originAttributes);Solves problem completely (but breaks signing, which i dont care for)
evilpie commentedon Sep 17, 2016
Can we get this fixed? @Hainish @jeremyn
bakulf commentedon Sep 19, 2016
You don't need to fix this issue. We make originAttributes an optional argument.
dholbert commentedon Sep 19, 2016
Ah, looks like that indeed changed in https://bugzilla.mozilla.org/show_bug.cgi?id=1259169 (a few months after this github-issue was filed).
OK, I think this issue can just be closed then -- it was addressed/worked-around by that ^^ Firefox bug.
(As a sanity-check that this is indeed fixed: I don't see any mentions of NS_ERROR_XPC_NOT_ENOUGH_ARGS in my error console, in my current Firefox session which has HTTPS Everywhere active.)
Vednier commentedon Sep 20, 2016
There is still tons of deprecation warnings instead in 51.0a1 (2016-09-19) (64-bit) Nighly
“nsICookieManager.remove()” is changed. Update your code and pass the correct originAttributes. Read more on MDN: https://developer.mozilla.org/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICookieManager HTTPS.js:164:6
“nsICookieManager2.add()” is changed. Update your code and pass the correct originAttributes. Read more on MDN: https://developer.mozilla.org/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICookieManager2 HTTPS.js:165:6
dholbert commentedon Sep 20, 2016
Ah, I guess I must not have exercised HTTPS Everywhere sufficiently in that browser-session.
@bakulf , are those warnings expected? If not, we should figure out what's causing them... Or if they are indeed expected, then we should indeed get this fixed in HTTPS Everywhere.
bakulf commentedon Sep 20, 2016
Those warnings are expected if OriginAttributes is not passed as argument, yes. I was commenting the title of the bug, and nsICookieManager.remove() doesn't throw NS_ERROR_XPC_NOT_ENOUGH_ARGS anymore, so this issue it's fixed.
I'm going to send a pull-request for this issue, but we should file a new for supporting originAttributes correctly. This means: privateBrowsing(?), WebExtensions and containers, these 3 features (and maybe in the future we could have more) are currently managed via OriginAttributes.
bakulf commentedon Sep 20, 2016
#6920
gloomy-ghost commentedon Sep 1, 2017
Closing as we are moving to WebExtension