obsproject / obs-browser

CEF-based OBS Studio browser plugin
GNU General Public License v2.0
785 stars 226 forks source link

Download Files into a proper Location #61

Closed CryZe closed 6 years ago

CryZe commented 7 years ago

At the moment files get downloaded into your temp folder with a random name. That is unfortunate for my use case, as users might want to save their changes.

OsirisNL commented 7 years ago

I'm not sure what you mean by this, can you explain your use case?

CryZe commented 7 years ago

My Use Case is an application that you can interact with, open files, modify them and later save them. This works fine in a normal browser, but while opening files does work in the browser source, saving them stores them in the temp folder with a random name, which is fairly unfortunate.

To test this yourself, just add any random website you can download something from, and click the download button. Nothing seems to happen, but it actually DOES download the file, but in a super useless way.

Fenrirthviti commented 7 years ago

Can you explain why you would need to have this kind of functionality through the browser source instead of just a normal browser? Your use case doesn't really make sense, as the browser source is not really designed to be used as an actual browser. What benefits are you getting by running this through the browser source?

CryZe commented 7 years ago

I'm working on a speedrun timer that you can use across pretty much any platform and you can use it in the browser as well. When you do speedruns you do those runs against your splits. So you want to be able to load and save them. All of this works really well, you just can't save them nicely in the browser source. The advantage over just window capturing your browser is that you want the speedrun timer to have nice transparency, that a normal window capture can't provide.

Here's the speedrun timer: https://cryze.github.io/LiveSplitOne/ Here's a recent VoD where this is used: https://www.twitch.tv/c_midknight/v/116306395?t=02h13m47s

dodgepong commented 7 years ago

Why not have the controls in a real browser, but then also have a URL that is just "view-only"? You don't want to be interacting with the splits timer in a way that viewers can see it. So you open a "Control" page to load and save files and control the stop/start/split etc, and then another view page that just outputs/renders the splits times and requires no interaction.

CryZe commented 7 years ago

That is certainly a possibility. However, the speedrun timer does not require any interaction with any server, it's a static webpage that does everything client-side. So this would require a HUGE architectural change. While it is planned that this will work eventually, I don't think this should be necessary here. The thing is, why does the "Interact" Window exist in the Browser Source? The Interact Window seems to suggest that there are a lot of valid use cases where you don't just use the Website as a "View", but you also interact with it. So making the interaction actually work in all kinds of valid use cases seems to be a reasonable extension to the browser source. If my use case would be completely unreasonable, I'd agree with not needing this change in the browser source. However the speedrun community is a fairly large part of Twitch and pretty much all of them already use the previous iteration of this timer. So this is not just some weird edge case pretty much no one needs, but a fairly large community. Since this should be a very small change to the browser source's codebase (this is probably just setting some configuration for CEF), it should be fairly easy to make this change and enable this use case.

Fenrirthviti commented 7 years ago

It's there for specific situations where you might need to log in to show certain content, but it's not really designed to be used in place of a normal browser for functions that require interaction. If you take a look at all the major browser source apps that are out there (streamlabs, kapchat, etc.) you'll notice that they all use the method of controlling the embedded page through an external page, not directly through browser source. I understand the speedrun community is not small, but this is still definitely a weird edge case. Please understand that you're asking for a major change to something that a lot of people use for one single use case. Changing the tool to be able to be controlled from a control page should not be that difficult. Why not look into making a proper plugin like livesplit had for OBS Classic?

However, the entire browser source is open source. Feel free to fork and make the necessary changes, and then submit a pull request for further review.