HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/root/usr/share/doc/elinks-data/examples/lua/remote.lua
-- ELinks-side part of elinks-remote

-- See script elinks-remote for explanation what's this about.

----------------------------------------------------------------------
--  User options
----------------------------------------------------------------------

-- File to look in for external url to jump to
   external_url_file = elinks_home.."/external.url"


----------------------------------------------------------------------
--  Implementation
----------------------------------------------------------------------

function external_url ()
   fh = io.open (external_url_file, "r")
   aline = current_url ()
   if fh then
      aline = read (fh, "*l")
      io.close (fh)
   else
      print ("Couldn't open outfile")
   end
   return aline
end

   bind_key ("main", "x",
             function () return "goto_url", external_url () end)


function set_external_url ()
   fh = io.open (external_url_file, "w")
   aline = current_link ()
   if fh then
      write (fh, aline.."\n")
      io.close (fh)
   else
      print ("Couldn't open outfile")
   end
end

    bind_key ("main", "X",
              function () set_external_url () end)

-- vim: shiftwidth=4 softtabstop=4