Skip to content

Commit c7bae47

Browse files
committed
Adding new notification API
1 parent d71dead commit c7bae47

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

background.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,4 @@ chrome.webRequest.onBeforeSendHeaders.addListener(function(details) {
129129
// Remove WebRTC local and public IP leakage
130130
chrome.privacy.network.webRTCIPHandlingPolicy.set({
131131
value: 'disable_non_proxied_udp'
132-
});
133-
134-
/*
135-
// Create a Notification
136-
chrome.extension.onRequest.addListener(
137-
function(request, sender, sendResponse) {
138-
var options = {
139-
type: "basic",
140-
title: "Someone is accessing your chrome canvas!!",
141-
message: "Extension has added noise to the imagedata",
142-
iconUrl: "icon16.png"
143-
}
144-
145-
chrome.notifications.create(options, callback);
146-
147-
function callback(){
148-
console.log("Someone accessed the canvas!!");
149-
}
150-
});
151-
*/
132+
});

tor.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ function toggleTorProxy(cb) {
3535
chrome.proxy.settings.set({ value: config, scope: 'regular' }, function() {
3636
proxied = !proxied;
3737

38+
if(proxied){
39+
// Create a Notification
40+
var options = {
41+
type: "basic",
42+
title: "You are in Tor network!!",
43+
message: "Browsing may be slow, but tor is safe",
44+
iconUrl: "icon16.png"
45+
}
46+
47+
chrome.notifications.create(options, callback);
48+
49+
function callback(){
50+
console.log("Someone accessed the canvas!!");
51+
}
52+
}
53+
3854
// From example https://developer.chrome.com/extensions/webRequest
3955
// update header processing
4056
chrome.webRequest.onBeforeSendHeaders.removeListener(processHeaders);

0 commit comments

Comments
 (0)