-
-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web: Properly panic when loading invalid SWF files (fix #14665) #14715
web: Properly panic when loading invalid SWF files (fix #14665) #14715
Conversation
86801f3
to
89eaf95
Compare
#6665 is related, and the main point listed in that issue will now cause a panic. However, it's still true that other asynchronous errors just log without being able to be handled without some custom JavaScript, so this doesn't fully close that issue. |
e0f857c
to
9182091
Compare
I think having the message be the same for invalid SWF vs SWF download fail is confusing, but I'm not sure how differentiating would be implemented- adding a new UI function feels like overkill. |
9182091
to
238e992
Compare
Maybe this can take a boolean parameter ruffle/web/packages/core/src/ruffle-player.ts Line 2244 in 3c11523
Then before these lines: ruffle/web/packages/core/src/ruffle-player.ts Lines 2277 to 2281 in 1b5eb2e
I can add this: } else if (invalidSwf) {
error.ruffleIndexError = PanicError.InvalidSwf; And before this line:
I can add And before this: ruffle/web/packages/core/src/ruffle-player.ts Line 2114 in 1b5eb2e
I can add: case PanicError.InvalidSwf:
errorBody = textAsParagraphs("error-invalid-swf");
errorFooter = this.createErrorFooter([new PanicLinkInfo()]);
break; And then I can add a message for ruffle/web/packages/core/texts/en-US/messages.ftl Lines 33 to 36 in 1b5eb2e
|
I thought of all that before making this PR, which is why my initial comment said I did it the way I did "for the purpose of code simplicity." |
784fd2d
to
c4b0f57
Compare
My new commit adds a message for invalid SWF files separate from the message for non-existent files and displays it in all appropriate situations (loading an existing non-SWF file via URL and loading an existing non-SWF file using the file selector). |
d6f0840
to
f9304a0
Compare
f9304a0
to
d725741
Compare
Note: The error when loading a page which is not an SWF is the same as the error when loading an SWF that does not exist for the purpose of code simplicity. This can be changed if desired.