Showing posts with label browser. Show all posts
Showing posts with label browser. Show all posts

Friday, 12 July 2019

Firefox build & compile in Ubuntu (Linux)


Firefox build:
  • Download
    • Using below Site:
    • Use python code to download
  • To build
    • Created new file ""mozconfig" with below content
                  # My first mozilla config
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
ac_add_options --enable-application=browser
ac_add_options --enable-debug
  • To run:
    • export MOZCONFIG=/home/labuser/image/software/firefox-68.0/mozconfig
    • ./mach build

  • Dependencies
    • Python 3.5
    • GCC 6.1
      • To install Latest gcc, pull code using svn
        • To checkout:
        • Dependencies:
          • Run below command it will download:
            • ./contrib/download_prerequisites
        • Build:
          • ./configure --program-suffix=-9   -> This option create gcc as gcc9
          • Make  (It take 3hr to build, may be can use "make -j 2")
            • In this place not able found the gcc or gcc-9 image.
          • Make install
            • Now gcc-9 -v shows the version 9 gcc. Worked
        • Multiple gcc
          • After install still facing firefox not build, becase it uses /usr/bin/gcc
          • So gave below symbolic link & G++ also
            • ln -s /usr/local/bin/gcc-9 gcc
  • sudo apt-get install libpulse-dev
  • curl https://sh.rustup.rs -sSf | sh
  • To install cbindgen dependen rust.
    • cargo install --force cbindgen
  • How it checking the dependency in python
    • checking for rustc... not found
    • checking for libpulse... Yes  -> Need to investiage how they check.
      • pulseaudio = pkg_check_modules('MOZ_PULSEAUDIO', 'libpulse', when='--enable-pulseaudio')
        • build/moz.configure/pkg.configure has definition.
      • Calling place:
        • sys.exit(main(sys.argv))
        • sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure'))
    • To check programs:
      • check_prog('TAR', ('gnutar', 'gtar', 'tar'))

Thursday, 14 June 2018

How firefox is working & know the DNS ?

How firefox is working & know the DNS ?

  • How firefox know the DNS ?

    • /etc/resolv.conf file is used to inform to firefox about the DNS server ip address.
    • This file contain the list of DNS IP address, using this IP address firefox send the DNS request to get the IP for given web page(Eg: google.com)
    • resolv.conf is the name of a computer file used in various operating systems to configure the system's Domain Name System (DNS) resolver.

  • How firefox is working:

    • While user give "google.com" and enter, first it will check the cache, if it cache contain this then load from cache.
    • Suppose first time we are giving, then cache dont have this information.
    • So it tries to resolve the "google.com" string into an IP address,
    • To conver IP address, firefox uses the DNS protocol,
    • As mentioned above it will get the DNS IP address and request DNS for google IP address.
    • Once it get the google.com IP address, then it will start the session to that IP address using TCP syn,
    • Google will reply back with Ack+syn,
    • Again firefox replay the ACK, now 3 way handshake is over and it will get the page from google and will load.
    • Usually google.com doesn't give only one flow, many flows (connnection) will be used to load the single google page.