jupyter-naas / chrome-extension

Boost productivity with Naas Chrome Extension, your AI-powered assistant for analytics and automation.
https://naas.ai
GNU Affero General Public License v3.0
2 stars 0 forks source link

Naas Chrome Extension V2 #12

Closed jravenel closed 1 year ago

jravenel commented 1 year ago

The idea is to leverage the right panel feature of chrome like this one Screenshot 2023-08-23 at 22 49 12

and use it as a base to integrate our workspace in it: Screenshot 2023-08-23 at 22 53 06 Reading List becomes Workspace Screenshot 2023-08-23 at 22 57 50 and other tab in dropdown can be 'Options' where we can find the info currently in the extension Screenshot 2023-08-23 at 22 59 38

hassan3kb commented 1 year ago

@jravenel please allow me access to Naas Workspace Alpha Program. I need to login for testing chrome extension.

jravenel commented 1 year ago

Hello @hassan3kb, 

Here is my video answer to your video - Watch Video

I noticed that when using Merlin, if you're not logged in, it takes you to the sign-up page. Only after signing up can you access the extension. I would like your input on this idea.

Just talked about it with @Dr0p42 - let's follow up here. There might be a trick to be done with token/cookies.

hassan3kb commented 1 year ago

@jravenel I cannot experience the login process (because I don't have access) image

Please allow me access at ghassanpk@gmail.com

I'll need to look into cookies for checking login status, please give me details about which cookie represents login status.

jravenel commented 1 year ago

@hassan3kb you have access now.

Dr0p42 commented 1 year ago

Hello @hassan3kb, I hope you are doing great. This information is not stored in a cookie but in the local storage for naas.ai

Image

here is an example

hassan3kb commented 1 year ago

Hello @Dr0p42 , the problem is I cannot access localStorage unless a tab is open (with url naas.ai/*) Is there any other way I can check if the user is logged in?

Dr0p42 commented 1 year ago

Hello @hassan3kb, in that case I need to do some testing on my side. We need to find a solution.

hassan3kb commented 1 year ago

@jravenel if the user is already logged in to naas.ai then the extension is good to go. I've pushed the code to v2 branch. Kindly check it out and give me feedback on this.

I'll update it, once @Dr0p42 finds a way to check login, if the user is not logged the extension will open the login page for the user.

jravenel commented 1 year ago

hello @hassan3kb I'm not able to test it, when I load unpacked extension from src file of repo. Maybe I'm doing something wrong. Can you write a short loom video about how to setup?

jravenel commented 1 year ago

@hassan3kb you can also come and chat here: https://join.slack.com/t/naas-club/shared_invite/zt-1970s5rie-dXXkigAdEJYc~LPdQIEaLA

Dr0p42 commented 1 year ago

Hello @hassan3kb, I think that we should update the code of workspace to allow it to know where it is and what should be done for authentication. I quickly took a look and it seems that on doing a window.location we get a url starting with chrome-extension:// so we should have a way to display to the user what he should do.

@hassan3kb for the authentication to work what do we need the user to do? Open and login naas.ai in a browser tab?

hassan3kb commented 1 year ago

Hey @Dr0p42 , one way to use cookies, the other way is to allow the top frame to access the website content when it's in an iframe.

Currently, I cannot access iframe.contentWindow because of some security rules. I think rules need to be updated.

jravenel commented 1 year ago

ok thanks @hassan3kb ! so let's try to deploy, test now? @Dr0p42