File tree Expand file tree Collapse file tree 6 files changed +83
-19
lines changed Expand file tree Collapse file tree 6 files changed +83
-19
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 3
3
"name" : " UkePass" ,
4
4
"version" : " 0.1" ,
5
5
"description" :" Salva suas senhas" ,
6
- "icons" : {"128" :" ./src/icon.png" },
7
- "permissions" : [" activeTab" ],
6
+ "icons" : {"128" :" ./src/assets/icon.png" },
7
+ "permissions" : [" activeTab" ," tabs" ],
8
+ "browser_action" :{
9
+ "default_popup" : " ./src/pages/popup.html"
10
+ },
8
11
"content_scripts" :[
9
12
{
10
13
"matches" : [
11
- " http://localhost/aplicacoes/WebImage/ "
14
+ " <all_urls> "
12
15
],
13
- "js" : [" content.js" ]
16
+ "js" : [" ./src/ content.js" ]
14
17
}
15
18
]
16
19
}
File renamed without changes.
Original file line number Diff line number Diff line change
1
+
2
+
3
+ function getPassword ( e ) {
4
+ console . log ( e . target . value ) ;
5
+
6
+ }
7
+
8
+ let password = document . getElementsByTagName ( "input" ) ;
9
+ password = Object . values ( password ) ;
10
+
11
+
12
+ password . map ( ( e ) => {
13
+ e . addEventListener ( "keyup" , getPassword ) ;
14
+ } ) ;
15
+
16
+ console . log ( 'Ukepass --- origin: content' )
17
+
18
+ /**
19
+ * Receiving popup message
20
+ */
21
+
22
+ chrome . runtime . onMessage . addListener ( receiver ) ;
23
+
24
+ // A message is received
25
+
26
+ function receiver ( request , sender , sendResponse ) {
27
+ console . log ( request . message ) ;
28
+ }
Original file line number Diff line number Diff line change
1
+
2
+ /**
3
+ * communication between index.js and content
4
+ */
5
+
6
+ let message = 'hello im a popup'
7
+ let msg = {
8
+ from : 'popup' ,
9
+ message
10
+ }
11
+ // A tab has be selected for the message to be sent
12
+ let params = {
13
+ active : true ,
14
+ currentWindow : true
15
+ }
16
+
17
+ // Now we've got the tabs
18
+ function gotTabs ( tabs ) {
19
+ // The first tab is the one you are on
20
+ chrome . tabs . sendMessage ( tabs [ 0 ] . id , msg ) ; //, messageBack);
21
+ }
22
+
23
+ let clickEvent = document . getElementById ( 'hello' )
24
+
25
+ clickEvent . addEventListener ( 'click' , ( ) => {
26
+
27
+ // This searches for the active tabs in the current window
28
+
29
+ chrome . tabs . query ( params , gotTabs ) ;
30
+
31
+ } ) ;
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
+ < title > Document</ title >
7
+ </ head >
8
+ < body >
9
+
10
+ < h1 >
11
+ Hello Ukepass
12
+ </ h1 >
13
+ < input type ="submit " id ="hello ">
14
+
15
+ < script src ="./index.js " > </ script >
16
+ </ body >
17
+ </ html >
You can’t perform that action at this time.
0 commit comments