C3 r25 introduces a new addon testing mode

For discussion and help with the Construct 3 Plugin SDK

Post » Tue May 09, 2017 2:40 pm

Addon testing has been a little cumbersome in Construct 3, since you previously had to keep re-packaging a .c3addon file, and in some cases clear browser storage, to test an update to your addon. To fix this r25 adds a new addon testing mode which loads your addon from a local web server. This means C3 always loads the latest version of your addon files, making it much more convenient and quicker to iterate.

The steps to enable this mode are described in the SDK documentation in the testing developer addons section.
Scirra Founder
B
395
S
233
G
88
Posts: 24,376
Reputation: 193,852

Post » Tue May 09, 2017 7:18 pm

I'm very excited about this new testing mode for the sdk. Very cool.
B
15
S
5
G
3
Posts: 30
Reputation: 2,220

Post » Fri May 19, 2017 3:55 am

Any help on getting this to work with IIS (Windows 10)? I've got it browsing to it, but there still seems to be a CORS issue.


main.js:2 Refused to connect to 'http://localhost/c3plugins/demoplugin/addon.json' because it violates the following Content Security Policy directive: "connect-src 'self' blob: wss://signalling.construct.net wss://build.construct.net https://downloads.scirra.com localhost:*".

ne @ main.js:2
ǃJ.ǃugK @ main.js:2
ǃJ.ǃuTY @ main.js:2
Je.ǃuo.then.le @ main.js:149
main.js:2 Refused to connect to 'http://localhost/c3plugins/demoplugin/addon.json' because it violates the document's Content Security Policy.
ne @ main.js:2
ǃJ.ǃugK @ main.js:2
ǃJ.ǃuTY @ main.js:2
Je.ǃuo.then.le @ main.js:149
main.js:149 Error loading addon JSON: TypeError: Failed to fetch
at ne (main.js:2)
at Function.ǃJ.ǃugK (main.js:2)
at Function.ǃJ.ǃuTY (main.js:2)
at Je.ǃuo.then.le (main.js:149)
at <anonymous>
ǃJ.ǃuTY.then.then.catch.pe @ main.js:149
ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370

Post » Fri May 19, 2017 11:01 am

Maybe try localhost:80 in the URL? The Content Security Policy specifies localhost:* which I don't think matches just localhost.
Scirra Founder
B
395
S
233
G
88
Posts: 24,376
Reputation: 193,852

Post » Fri May 19, 2017 1:48 pm

Same thing AND same error. That is, the :80 is dropped from the log report.
ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370

Post » Fri May 19, 2017 5:08 pm

Maybe try Chrome Canary? I think that CSP syntax might be new.
Scirra Founder
B
395
S
233
G
88
Posts: 24,376
Reputation: 193,852

Post » Fri May 19, 2017 5:29 pm

Same thing.
ImageImageImage
B
71
S
21
G
233
Posts: 3,697
Reputation: 130,370

Post » Sat May 20, 2017 7:01 pm

Same problem, even using port 50001 and Canary.

What is strange that when calling the addon.json directly, the Content-Security-Policy looks right. However, it's different from the Policy shown in the error in the Console when calling it through Construct.

Any ideas?
B
21
S
5
Posts: 23
Reputation: 1,207

Post » Sun May 21, 2017 3:37 am

I'm getting the same "Refused to connect" issue due to document's Content Security Policy. I've tried http://localhost:8080/addon.json and http://localhost:80/addon.json with the latest Chrome.

Has anyone got this working? and ... what configuration worked?
B
15
S
5
G
3
Posts: 30
Reputation: 2,220

Post » Sun May 21, 2017 11:44 am

Hmm, the CSP also had to be updated on the server side so maybe there's a caching issue. Try clearing the browser cache.
Scirra Founder
B
395
S
233
G
88
Posts: 24,376
Reputation: 193,852

Next

Return to Plugin SDK

Who is online

Users browsing this forum: No registered users and 0 guests