I've been playing with chrome extensions. However, I'm not certain which function to call to grab part of a URL and fit it into another URL, then save it in the browser storage.
Problem: need to grab 123-event-id from https://ab.website/`123-event-id` and a button trigger to save it as https:// portal.website/events/123-event-id/summary with an option (button) to delete later.
Would really appreciate any help.
How to get the URL of the active tab
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
let url = tabs[0].url;
});
You can use localStorage or chrome.storage to store data.