Giter VIP home page Giter VIP logo

Comments (9)

cyrus-and avatar cyrus-and commented on May 18, 2024

The port decides the Chrome instance while you can attach to a specific tab/window using the chooseTab option.

Now, in parallel means that you will have several instances of the client:

Chrome(options1, function (chrome) { /*...*/ });
Chrome(options2, function (chrome) { /*...*/ });
// ...

from chrome-remote-interface.

MaestroJurko avatar MaestroJurko commented on May 18, 2024

Exactly, but how would you differentiate between windows? Can you specify to which window can Chrome connect to, and can multiple Chrome be connected to the same chromium browser?

from chrome-remote-interface.

cyrus-and avatar cyrus-and commented on May 18, 2024

There's no such thing as windows for what concerns the remote debugging protocols, only tabs, be them part of the same window or not. You can obtain the list of the currently opened tabs for a given browser instance identified by a port with Chrome.List, after that you can select one tab object from the returned array and feed it to the chooseTab option.

from chrome-remote-interface.

MaestroJurko avatar MaestroJurko commented on May 18, 2024

Ok thank you, will try. It is a bit of an issue, because as I understand, nw.js is build on chromium but it does not support tabs.

from chrome-remote-interface.

cyrus-and avatar cyrus-and commented on May 18, 2024

Different windows of the same Chrome instance are considered tabs. Try this:

  1. start your nw.js application like nw --remote-debugging-port=9222 /the/app;
  2. manage to open multiple windows;
  3. visit http://localhost:9222/json and see if there is an entry for each open window.

If that's the case you can use the method I described above.

from chrome-remote-interface.

MaestroJurko avatar MaestroJurko commented on May 18, 2024

Thx again.

from chrome-remote-interface.

MaestroJurko avatar MaestroJurko commented on May 18, 2024

I am having a little bit of trouble with never versions of nw.js - chromium and how to open my app inside of it.

Works with version 0.12.3:

Chrome.New({
    port: that.options.port,
    url: 'file:///' + config.launcher.def_officer_nwjs.appDir + '/index.html'
    }, function (err, tab) {
});

But with never versions ( > 0.12.3), url that is used for oppening app does not use file. First window that is successfully opened:

{
description: "",
devtoolsFrontendUrl: "/devtools/inspector.html?ws=localhost:12406/devtools/page/8573B029-FCF9-4EB2-B8BA-A5D2FFCD5EE4",
faviconUrl: "chrome://extension-icon/laeohklakmaeckjcebinbjcagklmbcnm/24/1",
id: "8573B029-FCF9-4EB2-B8BA-A5D2FFCD5EE4",
title: "nw-guardian-app",
type: "app",
url: "chrome-extension://laeohklakmaeckjcebinbjcagklmbcnm/index.html",
webSocketDebuggerUrl: "ws://localhost:12406/devtools/page/8573B029-FCF9-4EB2-B8BA-A5D2FFCD5EE4"
}

Version 0.12.3

url: 'file:///......'

Any suggestions on how to successfully open my app in new window?

from chrome-remote-interface.

cyrus-and avatar cyrus-and commented on May 18, 2024

I don't know, I've never used NW.js but I think you can always start a new application with nw using a child process (if you really need to do that from Node.js).

You should post a message on the NW.js mailing list, this doesn't seem to concern chrome-remote-interface.

from chrome-remote-interface.

MaestroJurko avatar MaestroJurko commented on May 18, 2024

Well I dont want to do that through nw, but with this library, because Chrome.New opens a new window. When ran with nw, it will open up a new browser.

Ok thank's for your help.

from chrome-remote-interface.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.