Using Object.defineProperty to wrap history.pushState generates NS_ERROR_XPC_BAD_OP_ON_WN_PROTO errors, but only for the first few calls to the wrapped method.

RESOLVED INVALID

Status

()

Core
General
RESOLVED INVALID
5 years ago
3 years ago

People

(Reporter: Justin Lebar (not reading bugmail), Unassigned)

Tracking

14 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Created attachment 621882 [details]
Testcase

STR:

* Open attached testcase
* Open web console
* Click the button
* Notice that you get "NS_ERROR_XPC_BAD_OP_ON_WN_PROTO: Illegal operation on WrappedNative prototype object"
* Keep clicking for a few seconds.
* Eventually, you'll stop getting the error and the pushState will work!

Surely we should either always throw or always work.

It seems to be timing dependent more than number-of-clicks dependent.  So maybe the error happens for the first N seconds after you open the page or something.
(Reporter)

Comment 1

5 years ago
> * Eventually, you'll stop getting the error and the pushState will work!

You'll notice because the URL of the page will change.

Comment 2

5 years ago
Might this be another variant of 593910?

Comment 3

3 years ago
I'm always getting
> TypeError: 'pushState' called on an object that does not implement interface History.
.. with this testcase on a nightly.

Can you still reproduce?

(In reply to dirk bergstrom from comment #2)
> Might this be another variant of 593910?
Making the bug link clickable: bug 593910.
In the testcase oldPushState is called with undefined this, which means it should throw every time with Web IDL bindings: the this object is not a History.  Bound functions for the win....
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.