Worker to update HTML element if it exists or create if it does not

I asked something in #workers-discussions but I think it belongs better here... Is it possible to write a worker that updates an HTML tag e.g. <title> if it's in the page, or inserts it if not? I can do one or the other, but I can't get it working when I need to try both. Have issues with ordering and closures. Maybe I can do some regex first? Any pointers appreciated!
1 Reply
Colin Asquith
Colin AsquithOP3y ago
Created a thread for this, still stuck on it... I have both create and update working, but hitting an issue with the ordering of when things run - it seems to depend what order things finish for me to tell if the content exists on the page... is my only option to run a Regex or something to preprocess the HTML to work things out?
Want results from more Discord servers?
Add your server