Edit extension after installation
Copy link to clipboard
Copied
I've been tasked with creating a script that can call an API through https from inside InDesign CC.
So I installed an extension called ExtendExtendScript / GetURL (https://coppieters.nz/?p=220​) that enables https-calls.
The problem is that it only supports GET, not POST, which the API requires. So I thought I'd alter the extension to add that functionality myself.
So I started editing the .js and .jsx files in the installation dir (C:\Users\USER_XXX\AppData\Roaming\Adobe\CEP\extensions\com.rorohiko.extendextendscript\node_modules\GetURL). But as soon as I do, it stops working. Even just adding "var a = 1;" will cause it to stop working.
Is there some form of validation or version handling that makes InDesign refuse to load an extension if it has been altered?
In that case, do you have any information about how to cirumvent that protection so I can extend an existing extension?
Copy link to clipboard
Copied
Hello,
It sounds like the author has very generously supplied the source code.
"The pre-packaged version that comes with the installer is as-is, but if you look at my other posts, all source code to GetURL is made available."
P.
Copy link to clipboard
Copied
Sure, the source code is available. But if I can't change the code in any way - it doesn't really help.
Somewhere there seems to be something that makes it tamper proof. Some kind of validation/encryption/other that prevents me from running modified js / jsx files from the extensions-folder.
So that's what I'm wondering about. What are the mechanisms behind it?
Do I need to alter the source code, then perhaps create my own zxp file with some kind of certificate somewhere, and then install my own version (which would be a very arduous way of doing it)?
I just can't seem to find any information on the topic.
Copy link to clipboard
Copied
"Do I need to alter the source code, then perhaps create my own zxp file with some kind of certificate somewhere, and then install my own version (which would be a very arduous way of doing it)?"
Thats the way forward.
P.
Copy link to clipboard
Copied
The extensions when released are code signed and hence any change in it would lead to the bundle verification to fail and this is the reason you see the code failing to load
Now for your use case you can create your own extension using the code that is available to you, if you need it for your own purpose you can enable debug option and you will not have to sign the code or obtain a certificate for you extension to load. However when you are ready to ship your final code you will need to buy a certificate or use a self signed certificate. The following link should help you
It would not be a very time consuming task if you have all the source code ready that you need to assemble into an extension, i think we have a plugin for brackets that creates an extension template ready to load. Once the template project is ready you just need to add in your code files and should be good to go.
-Manan
Copy link to clipboard
Copied
Moved to Extensions / Add-ons Development
See there for FAQ links that cover your question.
Setting Cep Debug Mode and Log Level the Easy Way | Creative-Scripts.com and HTML Panels Tips: #10 Packaging / ZXP Installers | Photoshop, etc.
There's quite a lot of info on signing if you don't manage with what is there.
Some interesting info on posting with https.
Following these post Include remote .js-file in script-file (and use it's variables) and Include Remote file in Windows I discovered that Windows 10 now includes Linux so one can now run a simple curl also on Windows as per http - What is the cURL command-line syntax to do a POST request? - Super User and deal with certificate issues with linux - Using client certificate in Curl command - Stack Overflow / ssl - https connection using CURL from command line - Stack Overflow
Combining all these links one could think about replacing the extension by RorohikoKris​ with a few lines of code. See also Re: Problems with getURL by Kris Coppieters .. by Marc Autret
HTH
Trevor
Copy link to clipboard
Copied
Hi,
As Manan indicated, you've bumped into a feature of CEP. Any changes to the source code invalidates the extension and it won't run until either
a) You re-sign the extension, so the new signature matches the source code changes
b) You switch your Creative Cloud settings to 'debug mode', so it will run extensions with invalid signatures
This has nothing to do with GetURL - it's a feature of CEP.
The easiest is to switch to debug mode. I've written some handy scripts to do that for you:
CEPSparker/setPlayerDebugMode.command at master · zwettemaan/CEPSparker · GitHub
CEPSparker/setPlayerDebugMode.bat at master · zwettemaan/CEPSparker · GitHub
Once you run these, you can change all you like and the extension should still run.