YAD not working for HTML

Trying to work on my tool to offer selective install of Applications.

Trying to flesh out my HTML usage in order to make use of JavaScript for dynamic mouse-over pop-up of Application descriptions or expanded details.

Can't seem to get basic HTML page loaded. :frowning:

Can anyone explain why it isn't being loaded by YAD?


Command scenarios attempted:

echo "Assumed PWD ..."
yad --html --uri=extrepoWeb.html --width=650 --height=480

echo "Relative PATH"
yad --html --uri=./extrepoWeb.html --width=650 --height=480

echo "Absolute PATH"
yad --html --uri=/DB001_F4/00__16__WindowsApplAlternatesOffer/Applications__OfferInstall/extrepoWeb.html --width=650 --height=480

echo "Using 'file://' operator for Absolute PATH"
yad --html --uri=file:///DB001_F4/00__16__WindowsApplAlternatesOffer/Applications__OfferInstall/extrepoWeb.html --width=650 --height=480

Prototype HTML Page [extrepoWeb.html]

<!doctype html>
<html>
	<head>
		<title>
			HTML Page Title
		</title>
	</head>
	<body>
		<h1> In-Page Title </h1>
		<p> Some content at <a href=file:/// >root</a> </p>
	</body>
</html>
1 Like

It seems you are not the only one facing this problem: It also doesn't work on my systems and, according to DuckAI, many others:

Common Issues with Yad HTML Display

Upgrade Problems

  • After upgrading from Yad 0.39 to 0.40, users reported that the --html option stopped working. This issue may be related to changes in the software version.

Blank Content

  • Some users experience blank content when using the --html option. This can occur on various systems, including Debian 12 and others. The dialog may show only buttons without any HTML content.

Terminal Warnings

  • When attempting to display HTML, terminal warnings may appear, such as issues with loading pixbufs or critical errors related to GTK. These warnings can indicate problems with the graphical environment or missing dependencies.

Troubleshooting Steps

Check Dependencies

  • Ensure that Yad is built with webkit support. Missing libraries can prevent HTML content from displaying correctly.

Test with Different Versions

  • If you encounter issues, try using different versions of Yad. Some users found that later versions resolved their problems.

Review Code

  • Double-check the command syntax. For example, ensure the URI is correctly formatted and accessible.

Check for Errors

  • Run Yad from the terminal to see if any error messages provide clues about the issue. Look for warnings or errors that may indicate what is going wrong.

By following these steps, you may be able to resolve the issue with Yad not displaying HTML content.

2 Likes

AFAIK, yad version 0.40.0 (the version shipped with UM) is not compiled with Webkit, GtkSourceView, or GSpell. If it were, then the yad --about dialog would list these options. See YAD Guide. Without Webkit, the HTML features of yad will not work.

3 Likes

So, Dave, you are saying that I need to download the source tarball and compile locally?


Do you have enough experience to confirm that the following correctly encompasses the required build process, as documented on the GitHub site?

I don't plan to start trying to build YAD myself until I have first ... completely ... characterized and defined the required process and preconditions.

Also, does anyone know what is implied by the "--enable-standalone" flag?


Script [preBuild__YAD.sh] :

#!/bin/sh

####################################################################################################
####################################################################################################
###
###		SCRIPT FUNCTIONS
###
####################################################################################################
####################################################################################################

yesOrNo()
{
	test ${mode} -eq 1 && { echo "\n\n\t Continue? [y|N] => \c" ; read ans ; }

	if [ -z "${ans}" ] ; then  ans="N" ; fi
	case "${ans}" in
		y* | Y* ) doit=1 ;;
		* ) doit=0 ;;
	esac
}

choiceToAbandon()
{
	if [ ${doit} -eq 0 ]
	then
		echo "\t Decision to abandon confirmed.  Bye!\n"
		exit 1
	fi
}

promptInstall()
{
	echo "\n\t Package '${pkg}' is required but not installed.  Install? [y|N] => \c" ; read ans

	yesOrNo

	if [ ${doit} -eq 1 ]
	then
		apt-get install "${pkg}"
	else
		echo "\n\t Mandatory pre-condition not met.  Process abandonned.\n" ; exit 1
	fi
}

#mode=1
#yesOrNo ; test ${doit} -eq 0 && { echo "\t Decision to abandon confirmed.  Bye!\n" ; exit 1 ; }
#exit



####################################################################################################
####################################################################################################
###
###		ENSURING PRECONDITIONS MET
###
####################################################################################################
####################################################################################################

tmp=/tmp/$(basename "$0" ".sh").tmp	; rm -f ${tmp}

mode=0
pkg="automake"

if [ -z "$( which "${pkg}" )" ]
then
	promptInstall "${pkg}"
fi

pkg="gettext"

if [ -z "$( which "${pkg}" )" ]
then
	promptInstall "${pkg}"
fi

pkg="webkit"

if [ -z "$( which "${pkg}" )" ]
then
	promptInstall "${pkg}"
fi


###
###	https://ayatanaindicators.github.io/
###	https://github.com/AyatanaIndicators
###	https://insights.linuxfoundation.org/project/ayatanaindicators-ayatana-indicator-application
###

dpkg-query -S ayatana | cut -f1 -d":" | sort | uniq >${tmp}

for pkg in gir1.2-ayatanaappindicator3-0.1 libayatana-appindicator3-1 libayatana-common0 libayatana-ido3-0.4-0 libayatana-indicator3-7
do
	if [ -z "$( grep "${pkg}" ${tmp} )" ]
	then
		promptInstall "${pkg}"
	fi
done



####################################################################################################
####################################################################################################
###
###		BUILD PROCESS
###
####################################################################################################
####################################################################################################

mode=1

autoreconf -ivf

	yesOrNo ; choiceToAbandon

./configure

	yesOrNo ; choiceToAbandon

make

	yesOrNo ; choiceToAbandon

make install

	yesOrNo ; choiceToAbandon

gtk-update-icon-cache

	#yesOrNo ; choiceToAbandon

exit 0
2 Likes

If you want that HTML feature, it would seem so. And to help you with that, I can recommend this tutorial ([Request] Add a Wiki Page: "Creating a Debian Package" · Issue #222 · v1cont/yad · GitHub) that contains detailed instructions for creating a deb package from the latest yad tarball. I used this procedure to build and install yad version 13.0 about two years ago when I was working on my touchscreen utilities. It worked well, but I don't recall whether it pulled in all the bells and whistles: Webkit, GtkSourceView, GSpell. The quickest way to determine that might be to follow the tutorial to build and install the new yad version and then run the command yad --about. The dialog that pops up should say whether those features are included in the new build.

Ultimately, I uninstalled yad 13.0 and reinstalled yad 0.40.0. Version 13 had some nice improvements, such as a switch widget in the --form dialog, but I decided if others were going to use my utilities, then it was asking too much to instruct them to build and install the latest yad version. My utilities have enough configuration steps as is.

No, I don't. I only followed the process in the tutorial cited above, then used used apt to remove the existing yad 0.40.0, and then used gdebi to install the 13.0 deb package.

BTW: The yad package is X11-only. I did a little research and found this site ([feature request] Add Wayland support · Issue #159 · v1cont/yad · GitHub) that reports that yad works (mostly, anyways) under the XWayland shim, and that the few features of yad that Wayland breaks will work if every call to yad is preceded by an environment variable assignment. Example:

GDK_BACKEND=x11 yad --form ...

I haven't verified this because I don't have a desktop with Wayland. My understanding is that gtk3 and gtk4 are being designed and/or retrofitted to work with either an X11 server or Wayland, and that the environment variable forces the GTK features used by yad to fall back to rendering widgets, etc., compatible with X11. (I probably mangled that explanation; forgive me.)

In any event, using the GDK_BACKEND=x11 environment variable assignment before the yad command should be "redundant but harmless" on any X11 desktop, such as MATE. So it might be good practice to start including that in our scripts, hoping to Wayland-proof them as much as possible. Just a thought.

BTW #2: I can't find it now--I must have neglected to bookmark it--but I remember reading a thread with a post by an Ubuntu or Debian maintainer several years ago who said that bumping the yad version beyond 0.40.0 broke some existing system scripts. If that's still true, it's bad news, because it could mean we're stuck with this old version forever.

3 Likes

Here's another link: GitHub - rweckert/yad-14.0-Setup-From-Scratch: Step-by-step setup installation of YAD 14.0+ from scratch. · GitHub

I haven't verified it, but it does explicitly mention webkit.

3 Likes

Thank you, Dave, for all that good information. I will dig in to make sure I don't hit any roadblocks! :slight_smile:

Very much appreciated.

1 Like