A bit of a weird one. I have some code that execu...
# suitescript
j
A bit of a weird one. I have some code that executes fine in the console that uses
require
to call a client script. I’d like to be able to execute this using a chrome extension, but when I try, I get
onpageload.js:8 Uncaught ReferenceError: require is not defined
. I’ve put my code in a timeout that is well after the page loads. Why is it that I can use
require
in the console but not in my extension?
a
have you done other extension development before? I'm by no means an expert, but I had to give up on using timeouts for pageloads etc. I had to use a waitForElement function, with a promise. that said I'm just doing DOM stuff in my extensions not using suitescript / client scripts
j
I've tried what you're attempting for weeks with no success. If you figure it out, I'd certainly appreciate a solution 🙂
j
Dang….that was the last piece of the puzzle I needed to solve something that I spent a few hours on over the weekend. Foolish for me to assume that something that worked in console would work in the extension, I guess.
m
i've ended up using bookmarklets instead of an extension due to spending tons of time coming up with no solutions to the same problem
not ideal, but for personal use or a small audience it works well enough