App-FirefoxMultiAccountContainersUtils

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    called result metadata and is optional, a hash that contains extra
    information, much like how HTTP response headers provide additional
    metadata.

    Return value: (any)

  open_firefox_container
    Usage:

     open_firefox_container(%args) -> [$status_code, $reason, $payload, \%result_meta]

    CLI to open URL in a new Firefox tab, in a specific multi-account
    container.

    Examples:

    *   Open two URLs in a container called "mycontainer":

         open_firefox_container(
             container => "mycontainer",
           urls => ["www.example.com", "www.example.com/url2"]
         );

    *   If URL is not specified, will open a blank tab:

         open_firefox_container(container => "mycontainer");

    *   Open URL in a new tab in a new window:

         open_firefox_container(
             container => "mycontainer",
           urls => ["www.example.com"],
           extra_firefox_options_before => ["--new-window"]
         );

        This command passes the "--new-window" option to "firefox".

    This utility opens a new firefox tab in a specific multi-account
    container. This requires the Firefox Multi-Account Containers add-on, as
    well as another add-on called "Open external links in a container",
    <https://addons.mozilla.org/en-US/firefox/addon/open-url-in-container/>.

    The way it works, because add-ons currently do not have hooks to the
    CLI, is via a custom protocol handler. For example, if you want to open
    <http://www.example.com/> in a container called "mycontainer", you ask
    Firefox to open this URL:

     ext+container:name=mycontainer&url=http://www.example.com/

    Ref: <https://github.com/mozilla/multi-account-containers/issues/365>

    Related topics

    In Google Chrome browser, profiles is what you would use to separate
    sessions/cookies (and other things). Opening a URL in a specific profile
    from the command-line is easier with Chrome:

     % google-chrome --profile-directory="PROFILEDIRNAME" URL

    where "PROFILEDIRNAME" is a directory name under the profiles directory,
    typically "~/.config/google-chrome/" on Unix. You can use the
    list-chrome-profiles (with option "-l") (from App::ChromeUtils) to list
    Chrome profiles.

    This function is not exported.

    Arguments ('*' denotes required arguments):

    *   container* => *str*

        (No description)

    *   extra_firefox_options_after => *array[str]*

        Additional options (arguments) to put after the URLs.

    *   extra_firefox_options_before => *array[str]*

        Additional options (arguments) to put before the URLs.

    *   new_window => *bool*

        (No description)

    *   profile => *firefox::local_profile_name::default_first*

        (No description)

    *   urls => *array[str]*

        (No description)

    Returns an enveloped result (an array).

    First element ($status_code) is an integer containing HTTP-like status
    code (200 means OK, 4xx caller error, 5xx function error). Second
    element ($reason) is a string containing error message, or something
    like "OK" if status is 200. Third element ($payload) is the actual
    result, but usually not present when enveloped result is an error
    response ($status_code is not 2xx). Fourth element (%result_meta) is
    called result metadata and is optional, a hash that contains extra
    information, much like how HTTP response headers provide additional
    metadata.

    Return value: (any)

HOMEPAGE
    Please visit the project's homepage at
    <https://metacpan.org/release/App-FirefoxMultiAccountContainersUtils>.

SOURCE
    Source repository is at
    <https://github.com/perlancar/perl-App-FirefoxMultiAccountContainersUtil
    s>.

SEE ALSO
    "Open external links in a container" add-on,
    <https://addons.mozilla.org/en-US/firefox/addon/open-url-in-container/>
    (repo at <https://github.com/honsiorovskyi/open-url-in-container/>). The
    add-on also comes with a bash launcher script:
    <https://github.com/honsiorovskyi/open-url-in-container/blob/master/bin/



( run in 0.996 second using v1.01-cache-2.11-cpan-64ef6c95b5d )