easy-paste-chrome
easy-paste-chrome copied to clipboard
Add Custom Links
The user could add their own fields and links.
Are you going to work on this? @arpitgogia
Yes. Trying it out right now.
Cool! Let me know if you need any help. I think I have documented/commented the entire code properly.
Also, I think you will have to reload the extension using chrome.runtime.reload()
if some new link is added. Because you will have to create a new context menu for that link in background.js
I was able to insert a custom field into the popup. However it disappeared once the popup reloads. I'm guessing I should append the text fields for custom links in updateUI()
since that is called each time the popup opens. I'm out of time right now cause I have an exam tomorrow but I'll definitely implement this.
@arpitgogia You will have to save the any newly added link in localstorage and then check for localstorage before rendering the UI in the popup. This way, every time all the previously saved fields will be shown and can be removed/edited. When are you exams ending? When will you be able to work on this?
Practicals begin from tomorrow, and theory from next Monday till 27th. Practicals are on Monday, Wednesday and Thursday. It may get delayed if I can't get it working by tomorrow. So I guess you can go ahead with this.
Okay I will see into it, if you are not able to get it working by tomorrow.
Links can now be added from the form. They are getting stored as well. I'm however not able to add a context menu option. Code is at: https://github.com/arpitgogia/easy-paste-chrome/ I can generate a PR if it looks alright.
Just having custom links in popup won't make any sense. Please look into it if you're able to add them to context menus too.
@arpitgogia Are you still interested in working on this?
Yes. I'll try it out again.
I am afraid I'm having problems saving the newly added links. Where is the saving mechanism implemented?
The links are saved in localStorage
which is updated whenever a link is saved. So for new links you will need to save them in the same place only.