2
나는 http-on-modify-request를 듣고 요청을하는 페이지의 위치를 얻는 firefox 확장 xpcom 구성 요소를 가지고있다.파이어 폭스 확장 xpcom 구성 요소 내부에서 GET 요청을 시작하는 페이지 요소를 얻는 방법?
getLocationOfOriginatingWindow: function (httpChannel) {
try {
var notificationCallbacks;
if (httpChannel.notificationCallbacks) {
notificationCallbacks = httpChannel.notificationCallbacks;
}
else if (httpChannel.loadGroup && httpChannel.loadGroup.notificationCallbacks) {
notificationCallbacks = httpChannel.loadGroup.notificationCallbacks;
}
else {
return null;
}
return notificationCallbacks.getInterface(Components.interfaces.nsIDOMWindow).top.location;
}
catch (e) {
DEBUG("Exception getting Window Location: " + e + "\nChannel URI: " + httpChannel.URI.spec);
return null;
}
},
요청을 한 페이지 요소를 얻고 싶다. img, 스크립트 등). httpChannel에서이를 수행 할 수있는 방법이 있습니까?
콘텐츠 정책의 의미가 무엇인지 모르겠습니다. 페이지를보고 요청을받는 요소를 검색한다는 것은 일부 오브젝트 (스크립트, 플래시)가 상당히 불투명 할 수 있다는 점입니다. 어쩌면 당신은 정교 할 수 있을까요? –
콘텐츠 정책이라는 웹 페이지에서 리소스로드를 감지하는 시스템이 있습니다. 콘텐츠 정책에 등록하면 다른 콘텐츠 정책에 의해 아직 차단되지 않은 모든 리소스로드를 볼 수 있습니다. 볼 수있는로드 유형은 http://mxr.mozilla.org/mozilla-central/source/content/base/public/nsIContentPolicy.idl을 참조하십시오. – Neil