Created
August 26, 2019 19:10
-
-
Save ohaddahan/b46165763ab5fd10173c1f39432736b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global chrome*/ | |
import React from 'react'; | |
//import logo from './logo.svg'; | |
import './App.css'; | |
import Dashboard from "./components/Dashboard"; | |
export default class App extends React.Component { | |
componentWillMount() { | |
chrome.runtime.onMessage.addListener( | |
function(request, sender, sendResponse) { | |
console.log(sender.tab ? | |
"from a content script:" + sender.tab.url : | |
"from the extension"); | |
if (request.greeting == "hello") | |
sendResponse({farewell: "goodbye"}); | |
}); | |
} | |
render() { | |
return ( | |
<div className="App"> | |
<Dashboard/> | |
</div> | |
); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment