jxramos / webOrders

chrome extension to write web order history to a json report.
1 stars 0 forks source link

Implement code reuse for common functions #1

Open jxramos opened 8 months ago

jxramos commented 8 months ago

The extension has grown in scale to multiple vendors and it has been know for sometime that many functions are duplicated verbatim across the family of content scripts. Now is the time to consolidate this by figuring out how to import javascript modules within a context script execution environment.

Candidates for reuse

function downloadContent(filename, content)
function downloadJsonTransaction(transaction)
function parsePrice(item)
jxramos commented 8 months ago

Try out the import operations possible in Javascript. Does that syntax work under context scripts? Find out why if its not allowed. https://stackoverflow.com/a/77476316/1330381