From e8a3c885f6e598682e941f1386dc5deb17a37f60 Mon Sep 17 00:00:00 2001 From: Seamus1989 Date: Wed, 23 Nov 2022 18:03:15 +0000 Subject: [PATCH] fix: we so happy yes so happy --- src/manifest.json | 8 ++++++-- src/pages/Newtab/Newtab.jsx | 12 +++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) 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 (
logo - Edit src/pages/Newtab/Newtab.js and save to reload. + Hello{email ? `, ${email}` : ''}! PLANES