We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

ค้นหาฝ่ายสนับสนุน

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

เรียนรู้เพิ่มเติม

[e10s] I want to get from nsIObserver->nsIHttpChannel->nsIDOMWindow->nsIDOMDocument. How can I do it?

  • 1 การตอบกลับ
  • 1 คนมีปัญหานี้
  • 8 ครั้งที่ดู
  • ตอบกลับล่าสุดโดย cor-el

more options

Hello! My addon worked on FF41. Now I want to migrate on e10s. Use Firefox developer edition v43.

The example observer (c++).

NS_IMETHODIMP CFFObserver::Observe( nsISupports* aSubject, const char* aTopic, const char16_t* aData ) { ......... if ( lstrcmpA( aTopic, "http-on-modify-request" ) == 0 ) { CFFObserver::onSending( aSubject ); } .......... } void CFFObserver::onSending( nsISupports* IHttpChannel ) { .............. nsISupports* IDOMWindowOwner = m_gate.Channel_GetOwnerWindow( IHttpChannel ); ................. }

The example JS helper.

Channel_GetOwnerWindow: function( objChannel ) // This option does not worked in v43[e10s]; { try { var notificationCallbacks = objChannel.QueryInterface(Components.interfaces.nsIHttpChannel).notificationCallbacks; if ( !notificationCallbacks ) { var loadGroup = objChannel.QueryInterface(Components.interfaces.nsIRequest).loadGroup.notificationCallbacks; if ( loadGroup ) notificationCallbacks = loadGroup.notificationCallbacks; } if ( notificationCallbacks ) { return notificationCallbacks .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindow) .QueryInterface(Components.interfaces.nsISupports); } } catch ( err ) { this.ErrorOut( err ); } return null; }

Below code works but I cannot get document from getting nsIDOMWindow. Channel_GetOwnerWindow: function( objChannel ) { try { return objChannel.QueryInterface(Components.interfaces.nsIHttpChannel) .notificationCallbacks .getInterface(Components.interfaces.nsILoadContext).topFrameElement .QueryInterface(Components.interfaces.nsISupports); } catch ( err ) { this.ErrorOut( err ); } return null; }

Help me please resolve this problem. Thanks.

Hello! My addon worked on FF41. Now I want to migrate on e10s. Use Firefox developer edition v43. The example observer (c++). NS_IMETHODIMP CFFObserver::Observe( nsISupports* aSubject, const char* aTopic, const char16_t* aData ) { ......... if ( lstrcmpA( aTopic, "http-on-modify-request" ) == 0 ) { CFFObserver::onSending( aSubject ); } .......... } void CFFObserver::onSending( nsISupports* IHttpChannel ) { .............. nsISupports* IDOMWindowOwner = m_gate.Channel_GetOwnerWindow( IHttpChannel ); ................. } The example JS helper. Channel_GetOwnerWindow: function( objChannel ) // This option does not worked in v43[e10s]; { try { var notificationCallbacks = objChannel.QueryInterface(Components.interfaces.nsIHttpChannel).notificationCallbacks; if ( !notificationCallbacks ) { var loadGroup = objChannel.QueryInterface(Components.interfaces.nsIRequest).loadGroup.notificationCallbacks; if ( loadGroup ) notificationCallbacks = loadGroup.notificationCallbacks; } if ( notificationCallbacks ) { return notificationCallbacks .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsIDOMWindow) .QueryInterface(Components.interfaces.nsISupports); } } catch ( err ) { this.ErrorOut( err ); } return null; } Below code works but I cannot get document from getting nsIDOMWindow. Channel_GetOwnerWindow: function( objChannel ) { try { return objChannel.QueryInterface(Components.interfaces.nsIHttpChannel) .notificationCallbacks .getInterface(Components.interfaces.nsILoadContext).topFrameElement .QueryInterface(Components.interfaces.nsISupports); } catch ( err ) { this.ErrorOut( err ); } return null; } Help me please resolve this problem. Thanks.

เปลี่ยนแปลงโดย dlmr เมื่อ

การตอบกลับทั้งหมด (1)

more options