@@ -4207,6 +4207,29 @@ Wombat.prototype.initBlobOverride = function() {
4207
4207
this . $wbwindow . Blob . prototype = orig_blob . prototype ;
4208
4208
} ;
4209
4209
4210
+ Wombat . prototype . initIntersectionObsOverride = function ( ) {
4211
+ var orig_iobs = this . $wbwindow . IntersectionObserver ;
4212
+
4213
+ var wombat = this ;
4214
+
4215
+ this . $wbwindow . IntersectionObserver = ( function ( IObs ) {
4216
+ return function ( callback , options ) {
4217
+ if ( options && options . root ) {
4218
+ options . root = wombat . proxyToObj ( options . root ) ;
4219
+ }
4220
+
4221
+ return new IObs ( callback , options ) ;
4222
+ } ;
4223
+
4224
+ } ) ( this . $wbwindow . IntersectionObserver ) ;
4225
+
4226
+ this . $wbwindow . IntersectionObserver . prototype = orig_iobs . prototype ;
4227
+
4228
+ Object . defineProperty ( this . $wbwindow . IntersectionObserver . prototype , 'constructor' , {
4229
+ value : this . $wbwindow . IntersectionObserver
4230
+ } ) ;
4231
+ } ;
4232
+
4210
4233
Wombat . prototype . initWSOverride = function ( ) {
4211
4234
if ( ! this . $wbwindow . WebSocket || ! this . $wbwindow . WebSocket . prototype ) {
4212
4235
return ;
@@ -6668,6 +6691,9 @@ Wombat.prototype.wombatInit = function() {
6668
6691
this . overrideIframeContentAccess ( 'contentWindow' ) ;
6669
6692
this . overrideIframeContentAccess ( 'contentDocument' ) ;
6670
6693
6694
+ // IntersectionObserver constructor override
6695
+ this . initIntersectionObsOverride ( ) ;
6696
+
6671
6697
// override funcs to convert first arg proxy->obj
6672
6698
this . overrideFuncArgProxyToObj ( this . $wbwindow . MutationObserver , 'observe' ) ;
6673
6699
this . overrideFuncArgProxyToObj (
0 commit comments