ruffle icon indicating copy to clipboard operation
ruffle copied to clipboard

new Loader().contentLoaderInfo.loaderURL returns file:// instead of whole path

Open evilpie opened this issue 2 years ago • 4 comments

In Flash new Loader().contentLoaderInfo.loaderURL returns the whole path of the SWF, in Ruffle it's just file:///.

The value probably comes from either SwfMovie::empty or SwfMovie::empty_fake_compressed_len.

evilpie avatar Nov 28 '23 19:11 evilpie

https://github.com/ruffle-rs/ruffle/blob/master/core/src/avm2/globals/flash/display/loader.rs#L41: Seems the comment here was not a good idea: "Some LoaderInfo properties (such as 'bytesLoaded' and 'bytesTotal') are always accessible, even before the 'init' event has fired. Using an empty movie gives us the correct value (0) for them."

danielhjacobs avatar Nov 28 '23 19:11 danielhjacobs

This happens for http://www.freeaddictinggames.com/loader/ima-vast-preroll.swf?v=2 from https://github.com/ruffle-rs/ruffle/issues/8619#issuecomment-1830429920.

evilpie avatar Nov 28 '23 19:11 evilpie

https://github.com/ruffle-rs/ruffle/blob/master/core/src/avm2/globals/flash/display/loader.rs#L41

This was added by @Aaron1011 in #7636.

danielhjacobs avatar Nov 28 '23 19:11 danielhjacobs

See also #13965, because even with the fixed URL the RegExp still fails anyway.

evilpie avatar Nov 28 '23 19:11 evilpie