Need some help on snap build

Guys, i am trying to build web-scrapper in python using selenium.

for that i required firefox browser and geckodriver to run browser remotely.

is there any way to used pre-installed firefox browser of user system and geckodriver from mozilla release github page here:(https://github.com/mozilla/geckodriver/releases)???

i don’t want to add firefox as stage-snaps dependency in snapcraft.yaml because it increase size of my snap.

this is my snapcraft.yaml file:

name: testapp # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
  This is my-snap's description. You have a paragraph or two to tell the
  most important story about your snap. Keep it under 100 words though,
  we live in tweetspace and your description wants to look good in the snap
  store.

grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots

parts:
  testapp:
    # See 'snapcraft plugins'
    plugin: python
    python-version: python3
    source: .

apps:
  testapp:
    command: bin/testapp
    plugs:
      - home

so, is there any way to connect my snap to user system firefox and use geckodrive to run firefox??

The only option would be classic confinement, but this comes with its own set of troubles.

Seeing how wildly different the Firefox you will encounter may be on all the distros that support snaps, I would encourage you to actually ship a version of it and the driver in your snap. Otherwise you’ll have all kinds of issues dealing with incompatibility between your snap and the host.

I already think about classic confinement and i won’t go for it.

is there any documents or snapcraft documentation for this??

and how can i define version of firefox and geckodriver in my snapcraft.yaml file?

here is someone using chromium as a stage-snap in his package, adapting that to firefox should be doable: