Bug 468313 - Add permissions to safe-browsing so warnings don't keep showing up on attack sites. r=sdwilsh ui-r=limi
This commit is contained in:
@@ -2688,6 +2688,11 @@ function BrowserOnClick(event) {
|
|||||||
gBrowser.loadURIWithFlags(content.location.href,
|
gBrowser.loadURIWithFlags(content.location.href,
|
||||||
nsIWebNavigation.LOAD_FLAGS_BYPASS_CLASSIFIER,
|
nsIWebNavigation.LOAD_FLAGS_BYPASS_CLASSIFIER,
|
||||||
null, null, null);
|
null, null, null);
|
||||||
|
|
||||||
|
Services.perms.add(makeURI(content.location.href), "safe-browsing",
|
||||||
|
Ci.nsIPermissionManager.ALLOW_ACTION,
|
||||||
|
Ci.nsIPermissionManager.EXPIRE_SESSION);
|
||||||
|
|
||||||
let buttons = [{
|
let buttons = [{
|
||||||
label: gNavigatorBundle.getString("safebrowsing.getMeOutOfHereButton.label"),
|
label: gNavigatorBundle.getString("safebrowsing.getMeOutOfHereButton.label"),
|
||||||
accessKey: gNavigatorBundle.getString("safebrowsing.getMeOutOfHereButton.accessKey"),
|
accessKey: gNavigatorBundle.getString("safebrowsing.getMeOutOfHereButton.accessKey"),
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
#include "nsIDirectoryService.h"
|
#include "nsIDirectoryService.h"
|
||||||
#include "nsIKeyModule.h"
|
#include "nsIKeyModule.h"
|
||||||
#include "nsIObserverService.h"
|
#include "nsIObserverService.h"
|
||||||
|
#include "nsIPermissionManager.h"
|
||||||
#include "nsIPrefBranch.h"
|
#include "nsIPrefBranch.h"
|
||||||
#include "nsIPrefBranch2.h"
|
#include "nsIPrefBranch2.h"
|
||||||
#include "nsIPrefService.h"
|
#include "nsIPrefService.h"
|
||||||
@@ -4025,6 +4026,17 @@ nsUrlClassifierDBService::LookupURI(nsIURI* uri,
|
|||||||
rv = mWorker->CheckCleanHost(key, &clean);
|
rv = mWorker->CheckCleanHost(key, &clean);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
|
if (!clean) {
|
||||||
|
nsCOMPtr<nsIPermissionManager> permissionManager =
|
||||||
|
do_GetService(NS_PERMISSIONMANAGER_CONTRACTID);
|
||||||
|
|
||||||
|
if (permissionManager) {
|
||||||
|
PRUint32 perm;
|
||||||
|
permissionManager->TestPermission(uri, "safe-browsing", &perm);
|
||||||
|
clean |= (perm == nsIPermissionManager::ALLOW_ACTION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
*didLookup = !clean;
|
*didLookup = !clean;
|
||||||
if (clean) {
|
if (clean) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user