"This operation is insecure"

Get help using Construct 2

Post » Mon Mar 06, 2017 2:08 am

Hello again.

With help of this forum I streamlined the level loading process. Localhost worked great all the times.

Then I decided to upload "evening's revisions" to website, and I got this error thrown out:

DOMException [SecurityError: "The operation is insecure."

I have narrowed it down to the file loader.

Image

Is it possible to use this streamlined method with some tweaks or do I have to go back to the old method I had, with 1 event line per file all chosen manually.
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Mon Mar 06, 2017 10:56 am

It's probably the AJAX request. Are you sure your server is set up to allow requests like that?
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Mon Mar 06, 2017 12:53 pm

@Ashley it worked before when I had the files manually set up like this:

Image

and

Image

What do you think? Why would it work like this but not in the streamlined version?
In this we got the filenames from the roll down list, but in the streamlined used another type, that is called URL instead. To me it looks same enough, but maybe different code behind?
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Mon Mar 06, 2017 3:41 pm

No idea, I can't debug a screenshot. As always, sharing a minimal .capx is how these issues get solved.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Mon Mar 06, 2017 9:27 pm

@Ashley Ok, I have now prepared two files.

Working - the old way with awkward events and manually inserting. But it is working!
http://www.funnybunny.se/files/working.capx

The new way, streamlined and looking nice in events easier to manage. But only works in Localhost. :(
http://www.funnybunny.se/files/streamlined.capx

Realized now I forgot to remove the webgl effect! But it is easy to remove yourself if it matters.
Last edited by helena on Wed Mar 08, 2017 2:28 am, edited 1 time in total.
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Mon Mar 06, 2017 9:32 pm

Interesting, I saw the same error in the "working" example. But the files managed to be opened and read there. Interesting, maybe you can have more input on this one.

I asked my guy and he said I can't change settings of the server because it is a shared webserver service.
B
58
S
18
G
13
Posts: 447
Reputation: 10,735

Post » Tue Mar 07, 2017 11:06 am

Your streamlined example is simply returning 404 not found for the files. Look in the browser console.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Tue Mar 07, 2017 11:36 am

@helena

In the streamlined version you are loading "Level1.json" but in the manual version you are loading "Level1A.json"

Do both files exist?

Or do you need to change your streamlined version to request:
"Level" & FileNumber & "A.json"
instead of:
"Level" & FileNumber & ".json"
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
33
S
9
G
7
Posts: 450
Reputation: 6,780

Post » Tue Mar 07, 2017 2:14 pm

@Ashley

Ooh!!! I was only looking at the Log portion of Console.

Not found, while in Local it works.
Then I went to the files in the output, and it looks like the process of exporting the files made all of them lowercase! (maybe something to think of, Ashley?) When in the project the files had names with leading versale. Level1.json, Level2.json.

I changed the event to look for "level" not "Level" and it works now on server!

I guess the Local version is more forgiving for the lowercase vs uppercase.

@OddConfection
I know. :) The old version was grabbed from older version of my files and in these I had random file names by all manners such as Test1.json etc.

So in conclusion: the Export process of C2 turns filenames into lowercases. Pay attention to that. ;)

Yay, now I am pleased I can finally upload the game! (after I fixed the bugs of the newly introduced stuff I worked on meanwhile I was waiting on solution here)
B
58
S
18
G
13
Posts: 447
Reputation: 10,735


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests