When trying to start Firefox-esr with geckodriver in a CUI environment, firefox.core is output

Since I am using ChatGPT for translation, the sentences might not be accurate. Thank you for your understanding.

Here is what I have done:I installed firefox-esr using pkg install firefox-esr.

I am doing web scraping with Python, Selenium, and Geckodriver.I installed Selenium using pip install selenium, and I downloaded the Geckodriver source from the official website and compiled it.

When I run the Python script for web scraping [a.py], a firefox.core file is generated.

Investigation into the cause:After installing pkg install chromium and running [a.py], it worked successfully.

It seems that when Chromium’s dependency packages are installed, it works fine. I investigated which packages need to be installed for the script to work properly.As a result of my investigation, I found that when [noto-basic] is installed, the script runs successfully.

Since I don't usually use [ports], is it possible to include a package equivalent to [noto-basic] in the pkg for firefox-esr?

Thank you for reading.
 
Welcome to The FreeBSD Forums.

the Python script

Can you share the script here?

… is it possible to include a package equivalent to [noto-basic] in the pkg for firefox-esr? …

1726352114379.pngThe FreshPorts page for shows that x11-fonts/noto-basic is a runtime requirement for Chromium (and two other Chromium-based browsers). Also a requirement for things such as x11-fonts/google-fonts, meta port x11-fonts/noto, and x11/plasma5-plasma-integration.

You can install the x11-fonts/noto-basic package in isolation, without installing Chromium.

I doubt that maintainers of www/firefox-esr would want to add a requirement for noto-basic.
 
you need noto-emoji for emojis

Code:
sudo pkg install noto-emoji

a lot of youtube videos use emojis in the video title
and if you dont have noto-emoji installed then you will get a lot of broken video titles on youtube
 
Code:
(develop) % cat a.py
from selenium import webdriver
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.firefox.options import Options
import sys

url = "https://google.com"
options = Options()
options.add_argument("--headless")
selenium = None

try:
    driver = Service(executable_path='webdriver/geckodriver')
    selenium = webdriver.Firefox(service=driver, options=options)

except:
    print("Error: can not open geckodriver")
    sys.exit(1)

selenium.get(url)
print(selenium.page_source)

selenium.quit()
------------------------------------------------------------------------

Since I am using ChatGPT for translation, the sentences might not be accurate. Thank you for your understanding.

■ What is noto-basic?
noto-basic is part of Google's "Noto Fonts" and includes a basic character set font family.

■ Is there an equivalent provided by Firefox?
Firefox itself does not provide fonts. However, for use in Firefox, Mozilla recommends fonts that comply with web standards. Notable fonts include:
  1. Noto Fonts
    • Overview: A font provided by Google designed to display all characters correctly.
  2. DejaVu Fonts
    • Overview: A font family that supports a wide range of Unicode characters and many languages and scripts.
  3. Liberation Fonts
    • Overview: A font family provided by Red Hat, including open-source sans-serif, serif, and monospace fonts.
  4. Ubuntu Fonts
    • Overview: A font family designed for the Ubuntu operating system, intended for user interfaces and documents.
■ Is there something provided by FreeBSD?
FreeBSD itself does not provide fonts. However, the corresponding packages are available:
  1. noto-basic
  2. dejavu
  3. liberation-fonts-ttf
  4. ubuntu-font
■ Maintenance options to consider:

A. Given that geckodriver is not maintained, it’s best to assume a CUI (Command Line Interface) environment is not expected. Do nothing.

B. Since certain fonts are required for proper operation, display a message during installation to prompt the user to install the necessary fonts.

C. Considering that DejaVu Fonts does not depend on any particular enterprise or distribution, make DejaVu Fonts a dependency.

D. Other
 
… the sentences might not be accurate. Thank you for your understanding. …

Understood :)

FreeBSD itself does not provide fonts.

For FreeBSD base, the operating system, that is not true.



The truth is somewhat irrelevant to your objectives, but for reference:
  • the FreeBSD manual page for hier(7) describes three font/ directories.
hier is a FreeBSD-Project provided index of FreeBSD file system hierarchy.
 
Firefox itself does not provide fonts.

This is also not entirely true.

The FreeBSD Project-provided package for www/firefox installs:
  • TwemojiMozilla.ttf
Code:
% pkg info --list firefox | grep -i font
        /usr/local/lib/firefox/fonts/TwemojiMozilla.ttf
%
 
Code:
% ls -l /usr/local/share/fonts
ls: /usr/local/share/fonts: No such file or directory
% ls -l /usr/share/fonts
ls: /usr/share/fonts: No such file or directory
% ls -l /usr/X11R6/lib/X11/fonts
ls: /usr/X11R6/lib/X11/fonts: No such file or directory

Code:
% pkg info --list firefox-esr | grep -i font
        /usr/local/lib/firefox/fonts/TwemojiMozilla.ttf

Here is the command you entered.
Code:
% cd /usr/local/share
% sudo mkdir fonts
% cd fonts
% sudo ln -s /usr/local/lib/firefox/fonts/TwemojiMozilla.ttf ./

It worked without any issues. Thank you.

The results showed that for some reason, /usr/local/lib/firefox/fonts/TwemojiMozilla.ttf is not being used. However, placing it in /usr/local/share/fonts makes it work.

My impression: Is this a bug? It just feels off somehow.
 
Also, for reference:

Code:
% pkg provides /usr/local/share/fonts/twemoji-color-font-ttf
Name    : twemoji-color-font-ttf-14.0.2
Comment : Color emoji font using Twitter Unicode 10
Repo    : FreeBSD-ports
Filename: usr/local/share/fonts/twemoji-color-font-ttf/TwitterColorEmoji-SVGinOT.ttf
%
 
… My impression: Is this a bug? …

From Bugzilla@Mozilla bug 1686274 (2021, RESOLVED FIXED):

"… It looks like we added TwemojiMozilla.ttf in bug 1231701 for Windows XP and 7, where presumably built-in Emoji fonts weren't amazing. …"

Comment 14 draws attention to an advanced preference, the value of which now defaults to -1 with www/firefox 130.0_3,2:

gfx.bundled-fonts.activate

I assume the same default with www/firefox-esr.

You might try changing the preference in Firefox ESR to 1, instead of having a file system symbolic link to the font.
 
Back
Top