Modify a code

In this code when i call copyAllLinksOnCurrentTab it copies all links
can anyone help me modifying this code so that when I call copyAllLinksOnCurrentTab
it will copy the current tab title then the links then close the tab
this is the code:

I can only give you some pointers.
To get page (tab) title from content script, use β€œdocument.title”.
To get tab title from background script, you can access it through the β€œtab” object. See:
(tab object is returned by many β€œbrowser.tabs” API.
To close tab use "browser.tabs.remove":

Happy coding! :slight_smile:

1 Like

Thanks Anyway, I coded it successfully, here the addon:
The modified code is in js\background.js
link here

1 Like