Skip to content

Setting unsafefilebrowsing=0 disables file browsing entirely #19

@AgentConDier

Description

@AgentConDier

Issue description

When /api/v1/mpvinfo returns "unsafefilebrowsing":false, the browse button is disabled:
grafik

Expected behavior

  • The browse button works, but only allows access to the configured filebrowserpaths

How to reproduce

  1. Set unsafefilebrowsing=0 and configure filebrowserpaths
  2. Attempt to browse

If I hack the server to lie about it's configuration and send "unsafefilebrowsing":true, the browse dialog actually works as expected: I am only able to browse drives configured in filebrowserpaths, and pressing .. displays an error message.

Code Snippet
// remoteServer.js
async function getMPVInfo() {
  let fake_settings = Object.assign({}, settings);
  fake_settings.unsafefilebrowsing = true;
  return {
    "ffmpeg-version": await handle(mpv.getProperty("ffmpeg-version"))
      .then((resp) => resp[0])
      .catch(() => null),
    "mpv-version": await handle(mpv.getProperty("mpv-version"))
      .then((resp) => resp[0])
      .catch(() => null),
    "libass-version": await handle(mpv.getProperty("libass-version"))
      .then((resp) => resp[0])
      .catch(() => null),
    mpvremoteConfig: fake_settings,
    mpvremoteVersion: version,
  };    
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions