C3 r25 introduces a new addon testing mode

For discussion and help with the Construct 3 Plugin SDK

Post » Sat Jun 03, 2017 3:25 pm

This is working now! You have to setup https properly in Windows 10/IIS. This link explains what to do. Due to Chrome's drop of SHA-1, not all documented methods will work. This one did for me.
https://www.youtube.com/watch?v=zTlc5Z59FpA
ImageImageImage
B
71
S
21
G
203
Posts: 3,584
Reputation: 115,072

Post » Tue Jun 06, 2017 11:22 am

OK, the server's been updated - probably best to clear your browser cache before trying this, but it should work now providing you host on https://localhost . I assume that's what you're doing @blackhornet?

Setting up SSL for HTTPS can be a bit of a pain, I do want to support this on normal HTTP but browser security restrictions make that difficult.
Scirra Founder
B
383
S
225
G
86
Posts: 24,134
Reputation: 190,601

Post » Tue Jun 06, 2017 4:30 pm

Yes, the video shows how to add https to the current localhost site.
ImageImageImage
B
71
S
21
G
203
Posts: 3,584
Reputation: 115,072

Post » Thu Jun 15, 2017 12:33 pm

I seem to have got past most of the addon test mode issues on MacOS by using homebrew's nginx, and ssl using a keychain generated self signed key that is customized to include the subjectaltnam and authorized for ssl in the keychain. There was some tweaking of the nginx.conf file to contain the proper CORS http headers. If you don't have your self signed cert completely authenticated in Keychain, you won't even see responses sent back from the localhost web server when requested by C3. Also, port's nginx doesn't even install, so avoid that.

It sounds more painful than it was.

I do recommend anyone thinking of Tomcat shy away from it. The CORS filters do *NOT* allow the proper headers to go through in the HTTP response unless you're willing to write a custom filter to fix it.
B
14
S
5
G
3
Posts: 30
Reputation: 2,165

Post » Thu Jun 15, 2017 12:44 pm

The new addon testing mode gives me the following exception when trying to load the example plugin with the "Add dev addon" button.

Code: Select all
Error loading addon JSON:  SyntaxError: Unexpected string in JSON at position 367
ǃm.ǃ_f.then.then.catch @ main.js:149


This happens when I load the extracted example addon.json that has the following file list.

Code: Select all
{
   "is-c3-addon": true,
   "type": "plugin",
   "name": "My custom plugin",
   "id": "MyCustomPlugin",
   "version": "1.0.0.0",
   "author": "Scirra",
   "website": "https://www.construct.net",
   "documentation": "https://www.construct.net",
   "description": "Example custom Construct 3 plugin.",
   "editor-scripts": [
                  "plugin.js",
                  "type.js",
                  "instance.js"
               ],
   "file-list": [
      "c2runtime/runtime.js",
      "lang/en-US.json",
      "aces.json",
      "addon.json",
      "icon.svg",
      "instance.js",
      "plugin.js",
      "type.js"
   ]
}


All the C3 plugin files are available over https from localhost and this is the only error given by Chrome. I have not modified any files in the extracted plugin. Any ideas?
B
14
S
5
G
3
Posts: 30
Reputation: 2,165

Post » Fri Jun 16, 2017 5:19 am

I tested with r25 and it loads fine, so I was going to put in a bug for this. But then I re-tested on the latest version and it works there now. I'm not sure if it is working because it is cashing, or was broken because it was cashing, but it works for me now.

Btw, fantastic feature! Keep up the great work.
B
14
S
5
G
3
Posts: 30
Reputation: 2,165

Post » Tue Jun 20, 2017 2:39 pm

tgenedavis wrote:I seem to have got past most of the addon test mode issues on MacOS by using homebrew's nginx, and ssl using a keychain generated self signed key that is customized to include the subjectaltnam and authorized for ssl in the keychain. There was some tweaking of the nginx.conf file to contain the proper CORS http headers. If you don't have your self signed cert completely authenticated in Keychain, you won't even see responses sent back from the localhost web server when requested by C3. Also, port's nginx doesn't even install, so avoid that.

It sounds more painful than it was.


Is there any chance you could share some more detailed tips on how to do this? I've tried with no luck in Windows with a python server I found, also with XAMPP... in both cases using a self-signed certificate. Chrome keeps not-accepting the certificate so I haven't been able to load addons.
I can try on MacOS if it worked for you, so any details about your configuration would be very much appreciated :roll:
B
21
S
9
G
4
Posts: 13
Reputation: 4,713

Post » Sun Jun 25, 2017 4:45 am

It took me days to get just the right combination, so I don't remember enough details to put together a detailed instruction list. I can tell you what to search for in Google, though.

1) The first thing that you need to do is get your cert accepted by your OS to the point that

Code: Select all
https://localhost<someport>:<somefile>


results in the little green lock appearing next to the URL in Chrome. In MacOS this involves Keychain. In one of the previous posts, there is a video explaining how to do it for Windows. It's painful, and really Chrome is causing us headaches for no good reason, but it is doable.

2) You're going to have to get a web server running on localhost that actually supports CORS. Older webservers like Tomcat don't properly support CORS. Find a new one that either lets you specify the content of the HTTP header, or actually supports CORS properly. nGinx allows you to customize the HTTP header returned for HTTP Requests. That's how I finally got it working.
B
14
S
5
G
3
Posts: 30
Reputation: 2,165

Previous

Return to Plugin SDK

Who is online

Users browsing this forum: No registered users and 0 guests