home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.linux      Getting to be as bloated as Windows!      107,822 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 107,819 of 107,822   
   Maria Sophia to Maria Sophia   
   Re: =?utf-8?Q?Tutorial=3A_Firefox_right=   
   24 Feb 26 14:42:38   
   
   XPost: alt.comp.software.firefox, alt.comp.os.windows-10   
   From: mariasophia@comprehension.com   
      
   Maria Sophia wrote:   
   > This tutorial can be rightly titled something like:   
   >  *Adding a right-click Firefox menu item that calls a native program*   
      
   UPDATE:   
      
   I hate when we can't wrestle control of any app to make it do our bidding.   
   But... each failure at the 99.9% finish line, teaches us something that   
   we wouldn't have known unless someone told us or we learned the hard way.   
      
   This is learning how Firefox works in Windows the hard way for sure.   
   I tried again today, but with two changes:   
    a. Notepad.exe   
    b. Temp file   
      
   Everything is working except the final step, which should work in Linux,   
   but which isn't working (yet) in Windows. Yesterday I switched from gVim to   
   Notepad++, and today I switched to Notepad.exe on the temporary file.   
      
   Same thing happened again.   
      
   In all cases, Notepad++, gVim and even plain old Windows Notepad all fail   
   to appear for the same reason, which proves the issue has nothing to do   
   with the editor choice, the command line, Python, the BAT wrapper, the   
   registry entry, or the Firefox extension itself.   
      
   What this demonstrates is that Firefox's native messaging host on Windows   
   runs inside a non-interactive desktop session, which appears to be one that   
   cannot display GUI windows of any kind (as far as I can tell by testing).   
      
   The entire pipeline works perfectly, the temp file is created, the native   
   host returns success, and every step is logged, but Windows simply will not   
   show GUI applications launched from that isolated session.   
      
   This follow-up therefore focuses on a test of the native "Notepad.exe"   
   which failed at the last step, just as the other editors did.   
      
   The only change from yesterday's files are the gvim_host.py has a minor   
   change so as to invoke notepad.exe on the *temporary* file FF created.   
      
    gvim_host.py   
     import sys   
     import struct   
     import json   
     import subprocess   
     import tempfile   
     import os   
      
     EDITOR_PATH = r"C:\Windows\System32\notepad.exe"   
      
     def log(msg):   
         sys.stderr.write(str(msg) + "\n")   
         sys.stderr.flush()   
      
     def read_message():   
         raw_length = sys.stdin.buffer.read(4)   
         if not raw_length:   
             log("No length header, stdin closed")   
             return None   
         length = struct.unpack("

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca