Is it still possible to define the main method in the file corresponding to the Javascript-file option? I have a main method defined in my plugin, but it doesn’t seem to be executed.
The function util.buildQuery() doesn’t seem to support boolean-type values, and I’m trying to use it to convert options to url query, but I’m finding that all boolean-type data is being discarded.
I have a string type option and I want to show the action when the option is not null, how do I set the requirements, i tried it
Great question. I’ve checked the source and it seems util.buildQuery only accepts string parameters. Anything else will be discarded. (I need to document that, or maybe just remove it from the docs.)
So you could either wrap your params in String() to stringify them, or (better) use URLSearchParams instead, which is bundled with PopClip along with URL
(The util.buildQuery and related API is something I put together whilst first working on JS extensions, and it was a means to an end. Later I imported those standard URL and URLSearchParams APIs and today I would recommend using those. Again, I need to improrove the docs on this.)