Mozilla Destek’te Ara

Destek dolandırıcılığından kaçının. Mozilla sizden asla bir telefon numarasını aramanızı, mesaj göndermenizi veya kişisel bilgilerinizi paylaşmanızı istemez. Şüpheli durumları “Kötüye kullanım bildir” seçeneğini kullanarak bildirebilirsiniz.

Daha Fazlasını Öğren

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

  • 1 yanıt
  • 1 kişi bu sorunu yaşıyor
  • 8 gösterim
  • Son yanıtı yazan: 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 tarafından tarihinde düzenlendi

Tüm Yanıtlar (1)

more options