File tree Expand file tree Collapse file tree 4 files changed +42
-12
lines changed Expand file tree Collapse file tree 4 files changed +42
-12
lines changed Original file line number Diff line number Diff line change 44 "description" : " Time travel" ,
55 "manifest_version" : 2 ,
66 "page_action" : {
7+ "default_icon" : {
8+ "32" : " icon.png"
9+ },
710 "default_popup" : " page_action.html"
811 },
912 "background" : {
2427 " webRequestBlocking"
2528 ],
2629 "web_accessible_resources" : [
27- " scripts/deepclone_bundle.js"
30+ " scripts/deepclone_bundle.js"
2831 ],
2932 "devtools_page" : " devtools.html"
3033}
Original file line number Diff line number Diff line change 55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
66 < meta http-equiv ="X-UA-Compatible " content ="ie=edge ">
77 < title > Page Action</ title >
8+ < script src ="links.js "> </ script >
9+ < style >
10+ html , body {
11+ font-size : 14px ;
12+ min-width : 460px ;
13+ min-height : 60px ;
14+ }
15+ body {
16+ margin : 8px ;
17+ }
18+ hr {
19+ width : 100% ;
20+ }
21+
22+ button {
23+ height : 30px ;
24+ width : 100px ;
25+ outline : none;
26+ }
27+ a : link {
28+ text-decoration : none;
29+ }
30+ </ style >
831</ head >
932< body >
10- Page Action
11- < a href ="http://www.google.com "> Test - goto google</ a >
12- < button id ="color_btn "> CHANGE COLOR!</ button >
33+ < p > < strong > React Rewind</ strong > </ p >
34+ < p > Open Chrome developer tools, React Rewind tab is on the right.</ p >
35+ < a href ="https://rewindjs.io "> rewindjs.io</ a >
36+ < a href ="https://github.com/reactrewind/react-rewind "> Github</ a >
1337 < script src ="page_action.js "> </ script >
1438</ body >
1539</ html >
Original file line number Diff line number Diff line change 1- document . addEventListener ( 'DOMContentLoaded' , ( ) => {
2- const btn = document . querySelector ( '#color_btn' ) ;
3- btn . addEventListener ( 'click' , ( ) => {
4- chrome . tabs . query ( { active : true , currentWindow : true } , function ( tabs ) {
5- console . log ( tabs ) ;
6- chrome . tabs . sendMessage ( tabs [ 0 ] . id , "change_color" ) ;
7- } ) ;
8- } ) ;
1+ document . addEventListener ( 'DOMContentLoaded' , function ( ) {
2+ var links = document . getElementsByTagName ( 'a' ) ;
3+ for ( var i = 0 ; i < links . length ; i ++ ) {
4+ ( function ( ) {
5+ var ln = links [ i ] ;
6+ var location = ln . href ;
7+ ln . onclick = function ( ) {
8+ chrome . tabs . create ( { active : true , url : location } ) ;
9+ } ;
10+ } ) ( ) ;
11+ }
912} ) ;
You can’t perform that action at this time.
0 commit comments