6f3056fb1c519aeb262d6c1cc9f352652e3086ae
max
  Mon May 27 07:49:54 2024 -0700
not setting pix if run from command line, email from Lou that qa scripts are not running anymore

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 89daf89..38425d7 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -11183,41 +11183,50 @@
         }
     else
         cartSetString(cart, "highlight", newHighlight);
     cartRemove(cart, "addHighlight");
     }
 }
 
 void notify (char *msg, char *msgId)
 /* print a message into a hidden DIV tag, and call Javascript to move the DIV under the
  * tableHeaderForm element and un-hide it. Less obtrusive than a warn() message but still hard to miss. */
 {
 jsInlineF("notifBoxSetup(\"hgTracks\", \"%s\", \"%s\");\n", msgId, msg);
 jsInlineF("notifBoxShow(\"hgTracks\", \"%s\");\n", msgId);
 }
 
+static boolean noPixVariableSetAndInteractive(void) 
+{
+/* if the user is a humand and there is no pix variable in the cart, then run a
+ * piece of javascript that determines the screen size and reloads the current
+ * page, with the &pix=xxx variable added and return true. */
+return (isEmpty(cartOptionalString(cart, "pix")) && 
+    !sameOk(cgiRequestMethod(NULL), "POST") && // page reload after POST would lose all vars
+    !cartUsualBoolean(cart, "hgt.trackImgOnly", FALSE) && // skip if we're hgRenderTracks  = no Javascript
+    !cgiWasSpoofed() && // we're not run from the command line
+    !sameOk(cgiUserAgent(), "rtracklayer")); // rtracklayer has no javascript, so skip, see https://github.com/lawremi/rtracklayer/issues/113
+}
+
 extern boolean issueBotWarning;
 
 void doMiddle(struct cart *theCart)
 /* Print the body of an html file.   */
 {
 cart = theCart;
 
-if (isEmpty(cartOptionalString(cart, "pix")) && 
-    !sameOk(cgiRequestMethod(NULL), "POST") && // page reload after POST would lose all vars
-    !cartUsualBoolean(cart, "hgt.trackImgOnly", FALSE) && // skip if we're hgRenderTracks  = no Javascript
-    !sameOk(cgiUserAgent(), "rtracklayer")) // rtracklayer has no javascript, so skip, see https://github.com/lawremi/rtracklayer/issues/113
+if (noPixVariableSetAndInteractive())
 {
     jsIncludeFile("jquery.js", NULL);
     jsIncludeFile("utils.js", NULL);
     jsInlineF("addPixAndReloadPage();");
     return;
 }
 
 measureTiming = hPrintStatus() && isNotEmpty(cartOptionalString(cart, "measureTiming"));
 if (measureTiming)
     measureTime("Startup (bottleneck delay %d ms, not applied if under %d) ", botDelayMillis, hgBotDelayCurrWarnMs()) ;
 
 char *mouseOverEnabled = cfgOptionDefault("mouseOverEnabled", "on");
 if (sameWordOk(mouseOverEnabled, "on"))
     {
     /* can not use mouseOver in any virtual mode */