Web lists-archives.com

Re: How to Turn Off Autodiscovered Printers in Firefox?




On Tue 26 Sep 2017 at 13:55:33 -0500, Kent West wrote:

> On Tue, Sep 26, 2017 at 8:57 AM, Brian <ad44@xxxxxxxxxxxxxxx> wrote:
> 
> > On Tue 26 Sep 2017 at 12:08:02 +0000, Curt wrote:
> >
> > > On 2017-09-26, Brian <ad44@xxxxxxxxxxxxxxx> wrote:
> > > > On Tue 26 Sep 2017 at 00:15:31 -0500, Kent West wrote:
> > > >
> > > >> So when I go to select a printer in Firefox, there are many
> > autodiscovered
> > > >> printers to choose from. I don't want any of them in my list. How do
> > I turn
> > > >> this off?
> > > >
> > > > See later. But first stop or purge cups-browsed.
> > > >
> > > >> I found the two "browse" options in /etc/cups/cupsd.conf, but they
> > make no
> > > >> difference. I found /etc/cups/cups-browsed, but killing that daemon
> > makes
> > > >> no difference. In fact, killing CUPS altogether makes no difference
> > (except
> > > >> my desired printer then goes away), so obviously this isn't a CUPS
> > thing.
> > > >
> > > > Correct.
> >
> 
> If this isn't a CUPS thing, what's the value in stopping or purging
> cups-browsed?

It rules out cups-browsed as a source for printer discovery and makes
the next step more convincing.

> > > >> Then I discovered Avahi (and had to go into learning mode -
> > apparently this
> > > >> is also known as "Bonjour" and "Rendevous" and "ZeroConf", depending
> > on OS
> > > >> and version and situation). The most obvious tweaks in
> > > >> /"etc/avahi/avahi-daemon.conf", the two "disable-publishing..."
> > options,
> > > >> don't do anything.
> > > >
> > > > Indeed not. They affect publishing, not discovery.
> 
> As in "publishing to other computers on the network", not as in "publishing
> to applications, like Firefox, on this computer"?

More or less. The print dialog of Firefox browses Bonjour-broadcasted
remote printers and populates its dialog from what is detected.
 
> I don't mind Avahi discovering printers; I just don't want it "publishing"
> what it found to Firefox. Apparently I misunderstood the scope of the word
> "publish".

No. What you want is either Firefox not browsing Bonjour broadcasts or,
if it does, selectively displaying print queues/printers it discovers.
AFAIK, the first cannot be done. The second is the subject of an
upstream GTK bug report somewhere.
 
> > >> So, any one know how to tell Avahi to not publish found printers to
> > > >> Firefox's print dialog?
> > > >
> > > > All GTK applications can use avahi-daemon for printer discovery. It is
> > > > GTK you want to control, not avahi-daemon. gtk-print-backends is the
> > > > relevant property to use. Its default value is "file,cups".
> > > >
> > > > I think Firefox uses GTK3. In /etc/gtk-3.0 or ~/.gtk-3.0 you want to
> > > > create the file settings.ini and see what the contents
> > > >
> > > >   [Settings]
> > > >   gtk-print-backends=file
> > > >
> > > > do for you. (The file name and format is different for GTK2).
> >
> 
> When I do this, *all* my printers disappear from the Firefox dialog,
> including the one I've got in CUPS, which shows up in the CUPS web dialog
> (localhost:631) and in /etc/cups/printers.conf.

You have learned that "gtk-print-backends=file" achieves your objective
but has the side affect of removing local print queues too.

Restarting or reinstalling cups-browsed has no affect on this situation.
GTK apps get their printer lists directly from Bonjour broadcasts, so
neither cupsd nor cups-browsed is necessary.
 
> > > Some anonymous joe on the internet said you can edit the [server]
> > > section of the /etc/avahi/avahi-daemon.conf file and uncomment the
> > > 'enable-dbus=yes' line, changing that line to 'enable-dbus=no' and this
> > > will disable printer discovery (while retaining dns functionality).
> > >
> > > Whether this works or not, or how perilously or ridiculously close this
> > > edit is to just turning the damned avahi thing off altogether, I do not
> > > know.
> >
> > I tried this and the GTK print dialog took ages to come up. I'd also be
> > concerned about other possible knock-on effects. Why "damned avahi
> > thing..."? You make it sound evil.
> 
> When I tried this, it solved my problem, and I don't notice any delay
> issues.

Users of Qt apps, command line utilities and LibreOffice would not be
overjoyed by having their printing experience severely degraded. There
might also be other drawbacks to dbus deactivation. The issue with an
"anonymous joe" is the lack of any detail, explanation or testing
reports.

Try: in settings.ini have 'gtk-print-backends=file,lpr'. Print from the
dialog with 'lp -d <print_queue>'.

In the end it depends on what you and your users can live with.

-- 
Brian.