@@ -3,44 +3,44 @@ Called when the item has been created, or when creation failed due to an error.
3
3
We'll just log success/failure here.
4
4
*/
5
5
function onCreated ( ) {
6
- if ( browser . runtime . lastError ) {
7
- console . log ( `Error: ${ browser . runtime . lastError } ` ) ;
6
+ if ( chrome . runtime . lastError ) {
7
+ console . log ( `Error: ${ chrome . runtime . lastError } ` ) ;
8
8
} else {
9
9
//console.log("Item created successfully");
10
10
}
11
11
}
12
12
13
+ chrome . runtime . onInstalled . addListener ( ( ) => {
14
+ chrome . contextMenus . create ( {
15
+ id : "MD5" ,
16
+ title : chrome . i18n . getMessage ( "MD5" ) ,
17
+ contexts : [ "all" ]
18
+ } , onCreated ) ;
13
19
14
- chrome . contextMenus . create ( {
15
- id : "MD5 " ,
16
- title : browser . i18n . getMessage ( "MD5" ) ,
17
- contexts : [ "all" ]
18
- } , onCreated ) ;
20
+ chrome . contextMenus . create ( {
21
+ id : "separator0 " ,
22
+ type : "separator" ,
23
+ contexts : [ "all" ]
24
+ } , onCreated ) ;
19
25
20
- chrome . contextMenus . create ( {
21
- id : "separator0 " ,
22
- type : "separator" ,
23
- contexts : [ "all" ]
24
- } , onCreated ) ;
26
+ chrome . contextMenus . create ( {
27
+ id : "SHA1 " ,
28
+ title : chrome . i18n . getMessage ( "SHA1" ) ,
29
+ contexts : [ "all" ]
30
+ } , onCreated ) ;
25
31
26
- chrome . contextMenus . create ( {
27
- id : "SHA1" ,
28
- title : browser . i18n . getMessage ( "SHA1" ) ,
29
- contexts : [ "all" ]
30
- } , onCreated ) ;
31
-
32
- chrome . contextMenus . create ( {
33
- id : "SHA256" ,
34
- title : browser . i18n . getMessage ( "SHA256" ) ,
35
- contexts : [ "all" ]
36
- } , onCreated ) ;
37
-
38
- chrome . contextMenus . create ( {
39
- id : "SHA512" ,
40
- title : browser . i18n . getMessage ( "SHA512" ) ,
41
- contexts : [ "all" ]
42
- } , onCreated ) ;
32
+ chrome . contextMenus . create ( {
33
+ id : "SHA256" ,
34
+ title : chrome . i18n . getMessage ( "SHA256" ) ,
35
+ contexts : [ "all" ]
36
+ } , onCreated ) ;
43
37
38
+ chrome . contextMenus . create ( {
39
+ id : "SHA512" ,
40
+ title : chrome . i18n . getMessage ( "SHA512" ) ,
41
+ contexts : [ "all" ]
42
+ } , onCreated ) ;
43
+ } ) ;
44
44
45
45
/*
46
46
The click event listener, where we perform the appropriate action given the
0 commit comments