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: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/Tab
(tab object is returned by many β€œbrowser.tabs” API.
To close tab use "browser.tabs.remove": https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/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