Are you sure you want to go to an external site to donate a monetary value?
WARNING: Some countries laws may supersede the payment processors policy such as the GDPR and PayPal. While it is highly appreciated to donate, please check with your countries privacy and identity laws regarding privacy of information first. Use at your utmost discretion.
The following code works in its own HTML, but it doesn't seem to work in userscript.
Foo.classMethod() class Foo { static classMethod() { alert('hello') return 'hello'; } }
I googled for information about using object-oriented syntax in userscript. I didn't get anything. I just read the document and didn't find the answer.
Who knows what's going on ?
It "works" for you only because it's compiled into ES5 or otherwise reorganized by the bundler. The code is invalid by itself: class declarations are initialized in the order of their appearance in the source code as it's just a syntactic sugar for prototype assignments so you can use it only after it was declared. Move Foo.classMethod() to the end.
——wOxxOm
The problem has been solved. Thanks.