File tree Expand file tree Collapse file tree 4 files changed +54
-5
lines changed Expand file tree Collapse file tree 4 files changed +54
-5
lines changed Original file line number Diff line number Diff line change 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+ }
12+ } ) ;
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+ // "16": "images/icon16.png",
9+ // "24": "images/icon24.png",
10+ // "32": "images/icon32.png"
11+ // },
712 "default_popup" : " page_action.html"
813 },
914 "background" : {
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- < 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 >
1237 < script src ="page_action.js "> </ script >
38+ < script type ="text/javascript " src ="devtools.js "> </ script >
1339</ body >
1440</ html >
Original file line number Diff line number Diff line change 11document . addEventListener ( 'DOMContentLoaded' , ( ) => {
2- const btn = document . querySelector ( '#color_btn ' ) ;
2+ const btn = document . querySelector ( '#gitHub_btn ' ) ;
33 btn . addEventListener ( 'click' , ( ) => {
44 chrome . tabs . query ( { active : true , currentWindow : true } , function ( tabs ) {
5- console . log ( tabs ) ;
6- chrome . tabs . sendMessage ( tabs [ 0 ] . id , "change_color" ) ;
5+ chrome . tab . create ( { url :'https://github.com/reactrewind/react-rewind' } ) ;
76 } ) ;
7+ // chrome.runtime.getURL('https://github.com/reactrewind/react-rewind');
8+ // btn.addEventListener('click', () => {
9+ // chrome.tabs.query({ active: true, currentWindow: true }, function(tabs) {
10+ // console.log(tabs);
11+ // chrome.tabs.sendMessage(tabs[0].id, "change_color");
12+
13+ // });
814 } ) ;
915} ) ;
You can’t perform that action at this time.
0 commit comments