diff --git a/src/manifest.json b/src/manifest.json index 730ffeec2..cb96cb365 100755 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, - "name": "Takeoff", - "description": "A chrome extension that will help you to takeoff from your current tab to a new tab.", + "name": "Happy Tabs", + "description": "A chrome extension that will turn that frown upside down! :)", "options_page": "options.html", "background": { "service_worker": "background.bundle.js" @@ -16,6 +16,10 @@ "icons": { "128": "icon-128.png" }, + "permissions": [ + "identity", + "identity.email" + ], "content_scripts": [ { "matches": [ diff --git a/src/pages/Newtab/Newtab.jsx b/src/pages/Newtab/Newtab.jsx index 02da1245b..775a93331 100644 --- a/src/pages/Newtab/Newtab.jsx +++ b/src/pages/Newtab/Newtab.jsx @@ -3,13 +3,23 @@ import logo from '../../assets/img/logo.svg'; import './Newtab.css'; import './Newtab.scss'; import { Text } from '@chakra-ui/react' + const Newtab = () => { + const [email, setEmail] = React.useState(''); + chrome.identity.getProfileUserInfo({ accountStatus: 'ANY' }, function (info) { + console.log('ppppp', info) + if (info.email) { + setEmail(info.email) + } + }); + + const text = `Hello${email ? `, ${email}` : ''}!`; return (
src/pages/Newtab/Newtab.js and save to reload.
+ Hello{email ? `, ${email}` : ''}!