Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Научете повече

[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