mirror of
https://github.com/michivonah/click-guide.git
synced 2025-12-22 22:16:28 +01:00
add meta data to guide & improve error handling
This commit is contained in:
parent
1fcbe7b968
commit
b574265e65
5 changed files with 108 additions and 36 deletions
|
|
@ -1,5 +1,22 @@
|
|||
// Script which is executed on all web pages
|
||||
|
||||
// Page meta data
|
||||
const pageTitle = document.title;
|
||||
const domainFormatted = window.location.host.replace(/\./g, "-");
|
||||
|
||||
// set guide title
|
||||
chrome.storage.local.get("guideTitle", (data) => {
|
||||
if(!data.guideTitle){
|
||||
try{
|
||||
chrome.storage.local.set({ guideTitle: pageTitle });
|
||||
chrome.storage.local.set({ exportFilename: domainFormatted });
|
||||
}
|
||||
catch(error){
|
||||
console.error(`Error while saving guide metadata: ${error}`)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// load recording status & react to updates
|
||||
let isRecording = false;
|
||||
chrome.storage.local.get("recording", (data) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue