Search Support

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.

Learn More

Hierdie gesprek is in die argief. Vra asseblief 'n nuwe vraag as jy hulp nodig het.

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

  • 1 antwoord
  • 1 het hierdie probleem
  • 8 views
  • Laaste antwoord deur 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.

Gewysig op deur dlmr

All Replies (1)

more options