Skip to main content
Inspiring
October 3, 2018
Question

Edit extension after installation

  • October 3, 2018
  • 3 replies
  • 1300 views

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?

This topic has been closed for replies.

3 replies

Inspiring
October 5, 2018

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.

Trevor:
Legend
October 5, 2018

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 RorohikoKriswith a few lines of code. See also Re: Problems with getURL by Kris Coppieters ..  by Marc Autret

Legend
October 3, 2018

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.

tedskiAuthor
Inspiring
October 3, 2018

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.

Legend
October 3, 2018

"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.