Modify a code

Hi ALL,
In this code when i call copyAllLinksOnCurrentTab it copies all links
So,
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
Thanks
this is the code:
https://js.do/mazenhelmi000/470937

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: tabs.Tab - Mozilla | MDN
(tab object is returned by many “browser.tabs” API.
To close tab use "browser.tabs.remove": tabs.remove() - Mozilla | MDN

Happy coding! :slight_smile:

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