I am a swift coder, not a JavaScript coder. But, with the help of ChatGPT I am slowly getting there.
I am trying to create a Firefox extension that will export an XMP file scaped from specific data on a webpage.
const parser = new DOMParser();
const xmpDocument = parser.parseFromString(xmpData, 'text/xml');
const subjectReference = xmpDocument.querySelector('Iptc4xmpCore\\:SubjectReference').textContent;
const headline = xmpDocument.querySelector('photoshop\\:Headline').textContent;
const description = xmpDocument.querySelector('dc\\:description rdf\\:li').textContent;
const subject = xmpDocument.querySelector('dc\\:subject rdf\\:li').textContent;
console.log('Subject Reference:', subjectReference);
console.log('Headline:', headline);
console.log('Description:', description);
console.log('Subject:', subject);
I have the base manifest.json, popup HTML and JS files for a basic FF extension, but not familliar with the process.
Can anybody please advise ?