HEX
Server: LiteSpeed
System: Linux premium263.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: eastcjee (525)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /home/eastcjee/public_html/wp-content/plugins/presto-player/src/admin/blocks/shared/helpers.js
const helpers = {
  setUrlPrivate: () => {
    const separator = window.location.href.indexOf("?") === -1 ? "?" : "&";
    const newurl =
      window.location.href + separator + "presto_video_type=private";
    window.history.pushState({ path: newurl }, "", newurl);
  },
  setUrlPublic: () => {
    const separator = window.location.href.indexOf("?") === -1 ? "?" : "&";
    const newurl =
      window.location.href + separator + "presto_video_type=public";
    window.history.pushState({ path: newurl }, "", newurl);
  },
  unsetUrlParams: () => {
    let removed = removeURLParameters(window.location.href, [
      "presto_video_type",
    ]);
    window.history.pushState({ path: removed }, "", removed);
  },
};

function removeURLParameters(url, parameters = []) {
  const parsedUrl = new URL(url);
  parameters.forEach((param) => {
    parsedUrl.searchParams.delete(param);
  });

  return parsedUrl.href;
}

export default helpers;