Code Monkey home page Code Monkey logo

remote-browser's People

Contributors

bradparks avatar dbk91 avatar sangaline avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

remote-browser's Issues

How can we simulate typing?

I'm really excited about this project. A potential gotcha was pointed out in the hn thread, so I thought I'd take the conversation here since that thread seems to have lost momentum.

How can we simulate typing using remote-browser? Technically we can set an input element's value to something, or create keypress, keydown, etc. events. But it seems that webdriver takes a different approach that's closer to true user input. I don't know how webdriver does it, but the use case is a website that, say, auto-formats a phone number or credit card number as you type it. Sometimes these don't work when you set the value of the input field. Another example is JS-based validations. The type method on puppeteer and selenium seem to fool the browser into thinking a user is typing. How might we achieve this in remote-browser?

Logo proposal

Hi Sir @intoli , I am a graphic designer and I want to contribute to your project by proposing a logo as i have noticed that the project has no logo yet. I am giving this designs as a gift if you liked it i will send you the needed files asap. If you have suggestions like color preference just let me know sir and I will edit it.

Here are my designs: I made 2 designs

DESIGN 1

logomark
remotebrowser-01
logotype A
remotebrowser-02
logotype B
remotebrowser-03-03

remotebrowser-04

DESIGN 2

logomark
remote browser-05

logotype A
remote browser-06

logotype B
remote browser-07

remote browser-08

Best regards,
Tobaloidee

Consider Selenium/WebDriver compatible API

Supporting Selenium JavaScript API would be great as it seems to be more popular that WebExtensions API.
For example, navigation to url can be done in Selenium terms:

await driver.get('https://intoli.com');

instead of:

browser.tabs.create({ url: 'https://intoli.com' });

PS: some time ago I've made similar project - autotester. It's a browser extension that transforms selenium commands into WebExtensions API calls. Maybe it would be useful.

Failed to load extension from:. Manifest file is missing or unreadable

Hi, I'm having an issue trying the package.

The code is taken from the example.

const Browser = require('remote-browser').Browser;

(async () => {
  // Create and launch a new browser instance.
  const browser = new Browser();
  await browser.launch();

  // Directly access the Web Extensions API from a remote client.
  const tab = await browser.tabs.create({ url: 'https://intoli.com' });
  const screenshot = await browser.tabs.captureVisibleTab();
})();

I use macOs, firefox is my default browser. However, when I start with 'node index.js', Chrome is launched, and I receive the following error :
Failed to load extension from:. Manifest file is missing or unreadable

Add geckodriver as a dependency

It would be nice for people to be able to try things out without having to worry about installing geckodriver. We can strip this out when we move off of Selenium.

Is the javascript executed on the remote server or on the client browser?

When you connect remotely to a server. Is the javascript execution done on the remote server or on the client browser? i guess what i'm trying to figure out is that when you connect to a remote server does the browser becomes just a DOM viewer and all of the JS executions happens on a remote server. i'm in need of a library to create a cloud browser such as puffin. i need to offload all of JS executions to a remote server.

Add special handling for Safari's async arrow function serialization

Safari serializes async arrow functions to

async function (variable) => { // code }

which is invalid. This only happens for the outermost function, so it should be relatively easy to add special handling for this case. We should also report this to Safari, it seems to be in violation of the ECMA spec:

If the object was defined using ECMAScript code and the returned string representation is not in the form of a MethodDefinition or GeneratorMethod then the representation must be such that if the string is evaluated, using eval in a lexical context that is equivalent to the lexical context used to create the original object, it will result in a new functionally equivalent object.

Allow new connections from interactive browsers

This would be nice both for debugging and for quickly scripting things in your everyday browser. There are security considerations though. Perhaps a key would have to be entered and the client can do some proof of identity based on that.

How to intercept requests?

Hi,

I'm figuring out how to intercept requests. I have to following snippet inside my code:

    browser.webRequest.onBeforeRequest.addListener(
      function(details) {
        return { cancel: details.url.indexOf('news.ycombinator.com') != -1 };
      },
      { urls: ['<all_urls>'] },
      ['blocking'],
    );

Inside the manifest.json (remote-browser module) I've following permissions:

"permissions": ["<all_urls>", "tabs", "webRequest", "webRequestBlocking"]

But my code gives following error:

Invalid listener for webRequest.onBeforeRequest

What am I doing wrong?

No information regarding installation of the extension

The README makes multiple references to a 'Remote Browser' extension, but neither provides a link to it or any steps to to install it from source (possible the src/extension directory). I am really not sure if I am missing something, but it feels like a lot of people might get stuck here when trying to run remote-browser against their daily use browser.

The Tour of Remote Browser is actually a prototype?

When I take the "Intoli Remote Browser Tour" i. e. on page 5 and click on the Image Data entry within the console after running the example I get the following image which is basically Ok for privacy reasons but nonetheless other than what I would have expected?
screenshot-2018-4-17 a tour of remote browser - the web extensions api s browser automation framework

Improve the documentation

I have recently started using remote-browser and when I was working on it, I realized that the documentation is extremely lacking and it took me snooping around the code a lot of time to figure out what's happening.

Towards that effort, I would like to work on the documentation for this project and hence creating this issue so that we can discuss what all needs to be covered. A list of topics off the top of my head are:

  1. Setting up the browser extension
  2. How to pass arguments to the evaluateInContent function and the rationale behind why variables are not closed-over. This one took me quite some time to figure out till I realized that the function is serialized and sent over to the browser. In retrospect, it looks quite obvious, but would be very deterring to new users.
  3. A troubleshooting guide to wait for document loads. I am not sure how the evaluator.readyState works, but it didn't work for me. I am using a kind-of hack to wait before proceeding:
function waitFor(browser, tabId, elementLookupList) {
    return new Promise(resolve => {
        const interval = setInterval(checkForElements, 500);

        function checkForElements() {
            const allReadyPromise = elementLookupList.map(ele => {
                return browser[tabId](ele);
            })

            Promise.all(allReadyPromise)
                .then((elements) => {
                    if (elements.every(x => x)) {
                        resolve();
                    }
                })
        }
    });
}

// USAGE
await waitFor(browser, tabId, [
     () => document.getElementById('fldLoginUserId') != null,
     () => document.querySelectorAll("input[name='fldSubmit'][value='Continue']").length === 1
]);

  1. A few more examples of what can be done. I really like the format of the small video you have created to show a live session with a running browser. If the documentation can improve on the process, it would get a lot of people invested very quickly (or so is what I think).

I was thinking of starting with some basic additions to the current README, maybe add more details to each section - especially places where I got stuck and then move on to a caveats guide as well. Before starting, I'll share a quick outline of what I am thinking about the documentation and once we both agree that it looks good, I'll write it out and submit a PR.

Please let me know what else you think can be useful and should be included in the documentation and I'll work on the outline accordingly.

Strip out mocha parallelism

This is making the builds non-deterministic because port conflicts can arise. I don't think it's worth it to deal with this uncertainty for now, better to re-evaluate later when performance becomes an issue.

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.