Choice Script Changes To Run Tests With Firefox ver 68 ( See Post 12 & 31)

As above. Anyone else? If yes, Firefox has probably done something to break choicescript. Or did I just get a faulty new version of Firefox? (I’m not convinced as when I update, choicescript functions go backck to bring broken.)

Edit:
@dfabulich hope it’s ok to tag you to let you know this seems to be a problem?

8 Likes

Yep. I have the same issue. Thanks for hilighting that it was a Firefeox update problem. One moment it was working, and next moment it wasn’t. My FF must of stealthupdated.

2 Likes

I’m just glad I worked it out instead of continuing to go through my choicescript files.

You can get it working again if you need, but it means downgrading which isn’t a long term solution, but is a stopgap.

Anyone know if COG is aware, or do they need to be notified as this’ll affect their authors not on the forums as well.

EDIT: Actually be careful downgrading. I think it’s deleted all my passwords and bookmarks :cry:

2 Likes

Thanks for that. I reinstalled firefox, redownloaded CS but I couldnt even run the default demonstration script. Was confused but your post pointed me in the right direction.

I also downgraded and it works now. I don’t usually use firefox and I never save any passwords so I’m fine. Thanks for the warning though :stuck_out_tongue: hopefully you can recover those passwords and bookmarks.

1 Like

Yeah I just had a look and I’m hoping it looks like there’s a backup profile that might have my info in it if I’m lucky. Not going to touch it until I’ve got the latest version of firefox running again in case if causes any clashes. Very annoying though. If you save sites and passwords you forget how much you rely on them being there.

2 Likes

Anyone that has an issue with their profile can restore it by the following method:

https://support.mozilla.org/en-US/questions/1195682

2 Likes

Just writing in to say that I (now) know about this issue. It affects Firefox 68 and up. Firefox has adopted the same strict security rules as Google Chrome, preventing ChoiceScript from working when you double-click on it from the file system.

The bug fix is described here as a “security fix” indicating that Firefox is unlikely to “fix” this soon.

CVE-2019-11730: Same-origin policy treats all files in a directory as having the same-origin
A vulnerability exists where if a user opens a locally saved HTML file, this file can use file: URIs to access other files in the same directory or sub-directories if the names are known or guessed. The Fetch API can then be used to read the contents of any files stored in these directories and they may uploaded to a server. Luigi Gubello demonstrated that in combination with a popular Android messaging app, if a malicious HTML attachment is sent to a user and they opened that attachment in Firefox, due to that app’s predictable pattern for locally-saved file names, it is possible to read attachments the victim received from other correspondents.

I have some ideas about how to fix this, but I’m not likely to fix it today.

11 Likes

That’s tough.
I guess the only way to locally test – if you’re already updated your Firefox – is by compiling your game first?

Chrome with enabled local file access works as a temporary alternative. If you don’t want to downgrade firefox, that is.

edit:

--allow-file-access-from-files
Add this flag to a separate chrome shortcut. As a result CS will start working. Once chrome is closed it is disabled.

2 Likes

@Szaal you can manually downgrade. Files are on the Firefox site, but you can’t use your normal profile without risking corrupting it apparently, so you’ll lose all your settings and profile data. (But it looks like you can probably put them back once you upgrade again but no one hold me responsible for that as I haven’t tried to do it yet.) Make sure if you downgrade you turn off manual updates or it’ll be back to version 68 shortly after installing the downgrade.

Edit: Thanks for the tip @anon8836198, I might try that :slight_smile:

1 Like

I’ve just uploaded a possible workaround to Github. With this workaround in place, you can now test ChoiceScript in any desktop browser (Chrome, Firefox, Safari, or Edge, but not Internet Explorer 11).

If you grab the latest version of ChoiceScript up on Github, it’ll ask you a very strange question.

Please “Upload” Your Scenes

To begin, you’ll need to grant permission to “upload” your scenes folder containing startup.txt.

(We’re not actually going to transfer your code over the Internet, but this web page needs permission to upload your scenes folder in order to access your code and run it. The power to access your code would also grant us the power to transfer your code elsewhere, but we’re not going to do that. JavaScript programmers can read our JavaScript to verify that this is true.

Use the button below to select your scenes folder.

There will be a button at the bottom. The button has a different message on each browser, e.g. “Browse…” or “Choose File”. When you click it, you have to select your scenes folder, the folder containing startup.txt. Once that folder is selected, the game resumes normally.

Unfortunately, you have to “upload” your scenes folder each time you refresh index.html. :confounded:

I also fixed quicktest.html while I was working on it, but I didn’t yet fix randomtest.html or compile.html. (I ran out of time.)

10 Likes

The latest version of ChoiceScript on Github now has a working randomtest.html and compile.html. It still requires you to “upload” a folder on your computer, to grant us access to it. randomtest.html requires you to “upload” the entire choicescript folder; compile.html requires you to “upload” just the web folder.

In all three cases, it’s OK to “upload” the entire choicescript folder; we’ll search it to find the files we need.

8 Likes

I’m getting the error message “Couldn’t load scenes/startup.txt The file is probably missing or empty.”.
I have tested it with the other wips that I previously had no problems with – they are free of typos. But suddenly the new wip and everything else gives me the same error message.
And no, I’m not using safari, I’m using firefox, as recommended.

The error started happening since I accidentally opened unittest.js, but I haven’t touched the code in that file.

Edit: Trying playtest on dahsingdon works, so it’s not the scene file that is the problem.

I am used to code in tablet and phones due do it on go and have to go to a village with no internet access and no PC.

So for me firefox has destroyed my chances of use testing and play in the media I code most of time.

As Android don’t let me upload a entire folder only individual files within and HTML viewers show me the code of HTML java not run the test. So I am destroyed basically

I’m not talking about the new workaround solution, but in regards to the previous CS version:
From the little testing I tried, the new Firefox should still be able to run the compile game. Heck, even chrome can run the compiled game.

The problem is that while you can run the compiled game with the new FF, you can’t compile the game with FF. This means that using the compiler as a convenient method of testing is out of the picture.

1 Like

@poison_mara backdate your firefox to the previous build and then use a different up to date browser for web surfing. Not and ideal situation, but might be the only way you can manage it.

My tablet and my phone don’t back down to a previous version the back is for 68 I tried I even return my tablet to fabric data no avail

I don’t know about the phone, but you should be able to get the installation file for the old version off the firefox site I think for the tablet. It’s a complete installation and just reinstalls over the top of whatever used to be there. You need to turn off the autoupdate straight away though, or it’ll put version 68 back in as soon as it detects you don’t have the most up to date version.

https://support.mozilla.org/en-US/kb/install-older-version-of-firefox#w_i-still-want-to-downgrade-ae-where-can-i-get-the-previous-version

I just uploaded a new version of ChoiceScript that might help.

In my initial workaround attempt, I configured ChoiceScript to allow you to upload a folder, but, you’re right, Android doesn’t let you upload a folder. So in the latest version, I configured it to either allow you to upload a folder or to upload multiple files at once. You might be able to use that to open your scenes folder and select all of them at once.

3 Likes