Closed Bug 1639718 Opened 5 years ago Closed 5 years ago

Add an OnChannelBlocked UrlClassifier API

Categories

(Toolkit :: Safe Browsing, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: dimi, Assigned: dimi)

References

Details

Attachments

(3 files, 1 obsolete file)

No description provided.
Blocks: 1637371

ChannelClassifierService notifies "urlclassifier-before-block-channel"
event when a channel is going to be blocked by protection features.

It also provides an API for receivers to "unblock" the channel.

Sample usage:
this.service = Cc["@mozilla.org/url-classifier/channel-classifier-service;1"].getService(
Ci.nsIChannelClassifierService
);
if (this.service) {
this.service.addListener({
observe(aSubject, aTopic, aData) {
switch (aTopic) {
case "urlclassifier-before-block-channel":
let channel = aSubject.QueryInterface(Ci.nsIUrlClassifierBlockedChannel);
channel.unblock();
break;
}
},
})
}

Depends on D76837

Attachment #9150611 - Attachment is obsolete: true
Pushed by dlee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/35567ab8e0ab P1. Add ChannelClassifierService to support notifying/unblocking channel. r=baku https://hg.mozilla.org/integration/autoland/rev/10a7cc5f1b44 P2. Protection features call OnBeforeBlockChannel before blocking the channel. r=baku https://hg.mozilla.org/integration/autoland/rev/3a5f3040fbef P3. Add testcase r=baku
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: