Git Product home page Git Product logo

Comments (1)

parkeraddison avatar parkeraddison commented on June 1, 2024

Discussed in #18

Originally posted by Nikhilesh212 July 16, 2021
Hey, this is Nikhilesh from Viasat India. We are working on developing a video QoE for our network. We are using DANE to emulate Viasat like network, for that we need to integrate a chrome plugin with DANE, is there any way you could help us?

To use Google Chrome + ChromeDriver

You'll need to change the Docker image to install these rather than Firefox+Geckodriver. We'll need to change these lines:

# Install apt dependencies for web browsing
RUN apt-get update && \
apt-get install -y \
firefox-esr
# We'll need geckodriver in order to use selenium
#
# Here we're just finding the download url to the latest pre-compiled release
# for linux64, then downloading and extracting to a location that's part of PATH
RUN export org=mozilla && export repo=geckodriver && \
export tag=$(curl -s "https://api.github.com/repos/$org/$repo/releases/latest" \
| grep tag_name \
| cut -d'"' -f4) && \
wget -O- "https://github.com/$org/$repo/releases/download/$tag/$repo-$tag-linux64.tar.gz" \
| tar -xz -C /usr/local/bin

Here's an easy way of doing so:

# Install Google Chrome
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
    apt-get update && \
    apt-get install ./google-chrome-stable_current_amd64.deb

# Install ChromeDriver
RUN wget https://chromedriver.storage.googleapis.com/$(curl https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip && \
    unzip chromedriver_linux64.zip -d /usr/local/bin/

(don't forget to run make build and set the .system.use_local_images field to true in the config file so that the new Docker image will be used!)

To use a Chrome extension

You'll need to download the extension as a .crx file and drop it in the same directory as your selenium script. Then in the script you can use

driver.add_extension(<path to extension .crx file>)

to load in the extension.

We did this over at dane-tool/starter-scripts for a Firefox addon -- the addon file is in extensions/ and the streaming/endless-youtube.py script gets the absolute path to the addon then installs it. If you place the extension in the same directory then you can avoid the need for .parent stuff.

Hope this helps.

Originally posted by @parkeraddison in #18 (comment)

from dane.

Related Issues (3)

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.