MCPcopy
hub / github.com/RetireJS/retire.js / onExamineResponse

Function onExamineResponse

firefox/lib/main.js:132–154  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

130}
131
132function onExamineResponse(event) {
133 try {
134 let channel = event.subject.QueryInterface(Ci.nsIHttpChannel);
135 let tab = tabUtil.getTabForContentWindow(firefox.getWindowForRequest(event.subject));
136 let tabIdForRequest = firefox.getIdForTabElement(tab);
137 if (isChannelInitialDocument(channel)) {
138 resetInfoForTab(tabIdForRequest);
139 if (tabs.activeTab.id == tabIdForRequest) {
140 updateButton(tabInfo.get(tabIdForRequest).vulnerableCount);
141 }
142 }
143
144 if (/javascript/.test(channel.getResponseHeader("Content-Type"))) {
145 let requestedUri = event.subject.URI.spec;
146 if (repo.dontCheck(requestedUri)) {
147 return;
148 }
149 tabInfo.get(tabIdForRequest).jsSources.push(requestedUri);
150 }
151 } catch(e) {
152 }
153 return;
154}
155
156resetInfoForTab(tabs.activeTab.id);

Callers

nothing calls this directly

Calls 3

isChannelInitialDocumentFunction · 0.85
resetInfoForTabFunction · 0.85
updateButtonFunction · 0.85

Tested by

no test coverage detected