Simple web browser in Lua 06-02-2013, 04:18 PM
#1
This is a simple tab-based web browser in Lua. It makes use of a local browser.
V1.2
Change-log:
- fixed Go! button's height;
- load button image added (simple pure-Lua-coded image).
V1.1
Change-log:
- download source feature added;
- save source feature added.
V1.0
This is just a basic script, not well coded (mainly in the source structure and optimization), but, well, that's my first Lua script. Feedback is appreciated.
Demo
Aerodark theme
Note: demonstration videos are not up to date.
Please, report any bug you encounter and I'll fix it as soon as possible.
Known bugs:
- in-built Windows file browser asks for "overwriting" before the script does; though, the script does it with fucking charme and so I've got to find a way to not let Windows ask for it;
- current directory in file browser for saving source is not the starter directory; %windir% is instead the starter directory.
V1.2
Change-log:
- fixed Go! button's height;
- load button image added (simple pure-Lua-coded image).
Code:
-----------------------------------------------
-- Simple Web Browser v1.2 --
-- Coded by noize at www.hackcommunity.com --
-----------------------------------------------
require("iuplua")
require("iupluaole")
require("luacom")
local loadBtn = iup.image {
{2,2,2,2,2,2,2,2,1,1,2,2,2,2,2},
{2,2,2,2,2,2,2,2,1,1,1,2,2,2,2},
{2,2,2,2,2,2,2,2,1,1,1,1,2,2,2},
{1,1,1,1,1,1,1,1,1,1,1,1,1,2,2},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,2},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,2},
{1,1,1,1,1,1,1,1,1,1,1,1,1,2,2},
{2,2,2,2,2,2,2,2,1,1,1,1,2,2,2},
{2,2,2,2,2,2,2,2,1,1,1,2,2,2,2},
{2,2,2,2,2,2,2,2,1,1,2,2,2,2,2};
colors = { "230 230 230" , "0 50 210" },
}
local http = require("socket.http")
local ltn12 = require("ltn12")
function readf(file)
local f = io.open(file, "rb")
if not f then return nil end
return f:read("*a")
end
function writef(file, text)
local f = io.open(file, "w")
f:write(text)
f:close()
end
function toVar(cmd)
local handle = io.popen(cmd)
var = handle:read("*a")
handle:close()
end
toVar("echo %cd%")
function save()
local f = io.open("tempSourceFile.data", "rb")
if f then f:close() end
if f ~= nil then
sourceData = readf("tempSourceFile.data")
filedlg = iup.filedlg {dialogtype="", title = "Save source", filter = "*.*", filterinfo = "All files", directory=var}
filedlg:popup (iup.ANYWHERE, iup.ANYWHERE)
status = filedlg.status
if status == "1" then
writef(filedlg.value,sourceData)
iup.Message("Save successful!","Source was successfully saved to " .. filedlg.value .. ".")
elseif status == "0" then
msg = iup.Alarm("Save source", "File already exists. Do you want to overwrite it?" ,"Yes" ,"No" ,"Cancel")
if msg == 1 then
writef(filedlg.value,sourceData)
iup.Message("Save successful!","Source was successfully saved to " .. filedlg.value .. ".")
elseif msg == 2 then
save()
elseif msg == 3 then
return iup.CLOSE
end
end
else
iup.Message("Error","Failed to open temp file: no temporary source file found.")
end
end
function removeTemp()
os.remove("tempSourceFile.data")
local f = io.open("tempSourceFile.data", "rb")
if f then f:close() end
if f ~= nil then iup.Message("Error","Failed to remove temp file") else iup.Message("File removed","Temp file was successfully deleted") end
end
if not iupx then iupx = {} end
function iupx.menu(templ)
local items = {}
for i = 1,#templ,2 do
local label = templ[i]
local data = templ[i+1]
if type(data) == 'function' then
item = iup.item{title = label}
item.action = data
elseif type(data) == 'nil' then
item = iup.separator{}
else
item = iup.submenu {iupx.menu(data); title = label}
end
table.insert(items,item)
end
return iup.menu(items)
end
function iupx.show_dialog (tbl)
local dlg = iup.dialog(tbl)
dlg:show()
iup.MainLoop()
end
function iupx.GetString (title,prompt,default)
return iup.GetParam(title, nil,prompt.." %s\n",default or "")
end
function iupx.pplot (tbl)
require("iupxpplot")
return iupxpplot.pplot(tbl)
end
require("iupluacontrols")
local ctrl1 = iup.olecontrol{"Shell.Explorer"}
ctrl1:CreateLuaCOM()
ctrl1.designmode = "NO"
ctrl1.com:Navigate("www.google.com")
local ctrl2 = iup.olecontrol{"Shell.Explorer"}
ctrl2:CreateLuaCOM()
ctrl2.designmode = "NO"
local ctrl3 = iup.olecontrol{"Shell.Explorer"}
ctrl3:CreateLuaCOM()
ctrl3.designmode = "NO"
local ctrl4 = iup.olecontrol{"Shell.Explorer"}
ctrl4:CreateLuaCOM()
ctrl4.designmode = "NO"
local ctrl5 = iup.olecontrol{"Shell.Explorer"}
ctrl5:CreateLuaCOM()
ctrl5.designmode = "NO"
local ctrl6 = iup.olecontrol{"Shell.Explorer"}
ctrl6:CreateLuaCOM()
ctrl6.designmode = "NO"
local ctrl7 = iup.olecontrol{"Shell.Explorer"}
ctrl7:CreateLuaCOM()
ctrl7.designmode = "NO"
local ctrl8 = iup.olecontrol{"Shell.Explorer"}
ctrl8:CreateLuaCOM()
ctrl8.designmode = "NO"
local ctrl9 = iup.olecontrol{"Shell.Explorer"}
ctrl9:CreateLuaCOM()
ctrl9.designmode = "NO"
local ctrl10 = iup.olecontrol{"Shell.Explorer"}
ctrl10:CreateLuaCOM()
ctrl10.designmode = "NO"
local bar1 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar2 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar3 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar4 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar5 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar6 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar7 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar8 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar9 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar10 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar11 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local label11 = iup.label {expand = "NO", title= " http://", size="30x10",}
local dash = " ------------------------------------------------------------------------"
about = dash .. "\n Simple Web Browser v1.2\n Coded by Noize at www.hackcommunity.com\n Language: Lua 5.1\n\n You are allowed to edit and give away the\n source code as long as you give credits.\n" .. dash
tab1 = iup.vbox {iup.hbox {bar1,iup.button {image = loadBtn,tip = "Load the page",size = "45x11",action = function() ctrl1.com:Navigate(bar1.value) end}},tabtitle = "Tab 1",ctrl1,}
tab2 = iup.vbox {iup.hbox {bar2,iup.button {title = "Go!",tip = "Load the page",size = "45x11",action = function() ctrl2.com:Navigate(bar2.value) end}},tabtitle = "Tab 2",ctrl2,}
tab3 = iup.vbox {iup.hbox {bar3,iup.button {title = "Go!",tip = "Load the page",size = "45x11",action = function() ctrl3.com:Navigate(bar3.value) end}},tabtitle = "Tab 3",ctrl3,}
tab4 = iup.vbox {iup.hbox {bar4,iup.button {title = "Go!",tip = "Load the page",size = "45x11",action = function() ctrl4.com:Navigate(bar4.value) end}},tabtitle = "Tab 4",ctrl4,}
tab5 = iup.vbox {iup.hbox {bar5,iup.button {title = "Go!",tip = "Load the page",size = "45x11",action = function() ctrl5.com:Navigate(bar5.value) end}},tabtitle = "Tab 5",ctrl5,}
tab6 = iup.vbox {iup.hbox {bar6,iup.button {title = "Go!",tip = "Load the page",size = "45x11",action = function() ctrl6.com:Navigate(bar6.value) end}},tabtitle = "Tab 6",ctrl6,}
tab7 = iup.vbox {iup.hbox {bar7,iup.button {title = "Go!",tip = "Load the page",size = "45x11",action = function() ctrl7.com:Navigate(bar7.value) end}},tabtitle = "Tab 7",ctrl7,}
tab8 = iup.vbox {iup.hbox {bar8,iup.button {title = "Go!",tip = "Load the page",size = "45x11",action = function() ctrl8.com:Navigate(bar8.value) end}},tabtitle = "Tab 8",ctrl8,}
tab9 = iup.vbox {iup.hbox {bar9,iup.button {title = "Go!",tip = "Load the page",size = "45x11",action = function() ctrl9.com:Navigate(bar9.value) end}},tabtitle = "Tab 9",ctrl9,}
tab10 = iup.vbox {iup.hbox {bar10,iup.button {title = "Go!",tip = "Load the page",size = "45x11",action = function() ctrl1.com:Navigate(bar10.value); ctrl2.com:Navigate(bar10.value); ctrl3.com:Navigate(bar10.value); ctrl4.com:Navigate(bar10.value); ctrl5.com:Navigate(bar10.value); ctrl6.com:Navigate(bar10.value); ctrl7.com:Navigate(bar10.value); ctrl8.com:Navigate(bar10.value); ctrl9.com:Navigate(bar10.value); ctrl10.com:Navigate(bar10.value) end}},tabtitle = "CTRL tab",iup.label{expand="NO",size="0x19",title=" The navigation on this page overwhelms all the others.",},ctrl10,}
tab11 = iup.vbox {iup.hbox {label11,bar11,iup.button {title = "Go!",tip = "Download the page",size = "45x11",action = function() httpget(bar11.value) end}},iup.hbox {iup.button {expand="HORIZONTAL",size="x16",title = "Save source to file",action = function() save() end}},iup.hbox {iup.button {expand="HORIZONTAL",size="x16",title = "Delete temporary source file",action = function() removeTemp() end}},tabtitle = "Source tab",}
tab12 = iup.label {expand="NO",title=about,tabtitle="About",}
tabs = iup.tabs {tab1,tab2,tab3,tab4,tab5,tab6,tab7,tab8,tab9,tab10,tab11,tab12,expand="YES"}
function httpget(str)
if bar11.value ~= "" then
http.request{
url = "http://" .. bar11.value,
sink = ltn12.sink.file(io.open("tempSourceFile.data","w"))
}
os.execute("start notepad tempSourceFile.data")
else
iup.Message("Error","No URL to download")
end
end
iupx.show_dialog {tabs; title="Simple Web Browser", size="440x180"}V1.1
Change-log:
- download source feature added;
- save source feature added.
Code:
-----------------------------------------------
-- Simple Web Browser v1.1 --
-- Coded by noize at www.hackcommunity.com --
-----------------------------------------------
require("iuplua")
require("iupluaole")
require("luacom")
local http = require("socket.http")
local ltn12 = require("ltn12")
function readf(file)
local f = io.open(file, "rb")
if not f then return nil end
return f:read("*a")
end
function writef(file, text)
local f = io.open(file, "w")
f:write(text)
f:close()
end
function toVar(cmd)
local handle = io.popen(cmd)
var = handle:read("*a")
handle:close()
end
toVar("echo %cd%")
function save()
local f = io.open("tempSourceFile.data", "rb")
if f then f:close() end
if f ~= nil then
sourceData = readf("tempSourceFile.data")
filedlg = iup.filedlg {dialogtype="", title = "Save source", filter = "*.*", filterinfo = "All files", directory=var}
filedlg:popup (iup.ANYWHERE, iup.ANYWHERE)
status = filedlg.status
if status == "1" then
writef(filedlg.value,sourceData)
iup.Message("Save successful!","Source was successfully saved to " .. filedlg.value .. ".")
elseif status == "0" then
msg = iup.Alarm("Save source", "File already exists. Do you want to overwrite it?" ,"Yes" ,"No" ,"Cancel")
if msg == 1 then
writef(filedlg.value,sourceData)
iup.Message("Save successful!","Source was successfully saved to " .. filedlg.value .. ".")
elseif msg == 2 then
save()
elseif msg == 3 then
return iup.CLOSE
end
end
else
iup.Message("Error","Failed to open temp file: no temporary source file found.")
end
end
function removeTemp()
os.remove("tempSourceFile.data")
local f = io.open("tempSourceFile.data", "rb")
if f then f:close() end
if f ~= nil then iup.Message("Error","Failed to remove temp file") else iup.Message("File removed","Temp file was successfully deleted") end
end
if not iupx then iupx = {} end
function iupx.menu(templ)
local items = {}
for i = 1,#templ,2 do
local label = templ[i]
local data = templ[i+1]
if type(data) == 'function' then
item = iup.item{title = label}
item.action = data
elseif type(data) == 'nil' then
item = iup.separator{}
else
item = iup.submenu {iupx.menu(data); title = label}
end
table.insert(items,item)
end
return iup.menu(items)
end
function iupx.show_dialog (tbl)
local dlg = iup.dialog(tbl)
dlg:show()
iup.MainLoop()
end
function iupx.GetString (title,prompt,default)
return iup.GetParam(title, nil,prompt.." %s\n",default or "")
end
function iupx.pplot (tbl)
require("iupxpplot")
return iupxpplot.pplot(tbl)
end
require("iupluacontrols")
local ctrl1 = iup.olecontrol{"Shell.Explorer"}
ctrl1:CreateLuaCOM()
ctrl1.designmode = "NO"
ctrl1.com:Navigate("www.google.com")
local ctrl2 = iup.olecontrol{"Shell.Explorer"}
ctrl2:CreateLuaCOM()
ctrl2.designmode = "NO"
local ctrl3 = iup.olecontrol{"Shell.Explorer"}
ctrl3:CreateLuaCOM()
ctrl3.designmode = "NO"
local ctrl4 = iup.olecontrol{"Shell.Explorer"}
ctrl4:CreateLuaCOM()
ctrl4.designmode = "NO"
local ctrl5 = iup.olecontrol{"Shell.Explorer"}
ctrl5:CreateLuaCOM()
ctrl5.designmode = "NO"
local ctrl6 = iup.olecontrol{"Shell.Explorer"}
ctrl6:CreateLuaCOM()
ctrl6.designmode = "NO"
local ctrl7 = iup.olecontrol{"Shell.Explorer"}
ctrl7:CreateLuaCOM()
ctrl7.designmode = "NO"
local ctrl8 = iup.olecontrol{"Shell.Explorer"}
ctrl8:CreateLuaCOM()
ctrl8.designmode = "NO"
local ctrl9 = iup.olecontrol{"Shell.Explorer"}
ctrl9:CreateLuaCOM()
ctrl9.designmode = "NO"
local ctrl10 = iup.olecontrol{"Shell.Explorer"}
ctrl10:CreateLuaCOM()
ctrl10.designmode = "NO"
local bar1 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar2 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar3 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar4 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar5 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar6 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar7 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar8 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar9 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar10 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local bar11 = iup.text {expand = "HORIZONTAL", tip = "Address box",}
local label11 = iup.label {expand = "NO", title= " http://", size="30x10",}
local dash = " ------------------------------------------------------------------------"
about = dash .. "\n Simple Web Browser v1.1\n Coded by Noize at www.hackcommunity.com\n Language: Lua 5.1\n\n You are allowed to edit and give away the\n source code as long as you give credits.\n" .. dash
tab1 = iup.vbox {iup.hbox {bar1,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl1.com:Navigate(bar1.value) end}},tabtitle = "Tab 1",ctrl1,}
tab2 = iup.vbox {iup.hbox {bar2,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl2.com:Navigate(bar2.value) end}},tabtitle = "Tab 2",ctrl2,}
tab3 = iup.vbox {iup.hbox {bar3,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl3.com:Navigate(bar3.value) end}},tabtitle = "Tab 3",ctrl3,}
tab4 = iup.vbox {iup.hbox {bar4,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl4.com:Navigate(bar4.value) end}},tabtitle = "Tab 4",ctrl4,}
tab5 = iup.vbox {iup.hbox {bar5,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl5.com:Navigate(bar5.value) end}},tabtitle = "Tab 5",ctrl5,}
tab6 = iup.vbox {iup.hbox {bar6,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl6.com:Navigate(bar6.value) end}},tabtitle = "Tab 6",ctrl6,}
tab7 = iup.vbox {iup.hbox {bar7,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl7.com:Navigate(bar7.value) end}},tabtitle = "Tab 7",ctrl7,}
tab8 = iup.vbox {iup.hbox {bar8,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl8.com:Navigate(bar8.value) end}},tabtitle = "Tab 8",ctrl8,}
tab9 = iup.vbox {iup.hbox {bar9,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl9.com:Navigate(bar9.value) end}},tabtitle = "Tab 9",ctrl9,}
tab10 = iup.vbox {iup.hbox {bar10,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl1.com:Navigate(bar10.value); ctrl2.com:Navigate(bar10.value); ctrl3.com:Navigate(bar10.value); ctrl4.com:Navigate(bar10.value); ctrl5.com:Navigate(bar10.value); ctrl6.com:Navigate(bar10.value); ctrl7.com:Navigate(bar10.value); ctrl8.com:Navigate(bar10.value); ctrl9.com:Navigate(bar10.value); ctrl10.com:Navigate(bar10.value) end}},tabtitle = "CTRL tab",iup.label{expand="NO",size="0x19",title=" The navigation on this page overwhelms all the others.",},ctrl10,}
tab11 = iup.vbox {iup.hbox {label11,bar11,iup.button {title = "Go!",tip = "Download the page",size = "45x12",action = function() httpget(bar11.value) end}},iup.hbox {iup.button {expand="HORIZONTAL",size="x16",title = "Save source to file",action = function() save() end}},iup.hbox {iup.button {expand="HORIZONTAL",size="x16",title = "Delete temporary source file",action = function() removeTemp() end}},tabtitle = "Source tab",}
tab12 = iup.label {expand="NO",title=about,tabtitle="About",}
tabs = iup.tabs {tab1,tab2,tab3,tab4,tab5,tab6,tab7,tab8,tab9,tab10,tab11,tab12,expand="YES"}
function httpget(str)
if bar11.value ~= "" then
http.request{
url = "http://" .. bar11.value,
sink = ltn12.sink.file(io.open("tempSourceFile.data","w"))
}
os.execute("start notepad tempSourceFile.data")
else
iup.Message("Error","No URL to download")
end
end
iupx.show_dialog {tabs; title="Simple Web Browser", size="440x180"}V1.0
Code:
-----------------------------------------------
-- Simple Web Browser v1.0 --
-- Coded by noize at www.hackcommunity.com --
-----------------------------------------------
require("iuplua")
require("iupluaole")
require("luacom")
if not iupx then iupx = {} end
function iupx.menu(templ)
local items = {}
for i = 1,#templ,2 do
local label = templ[i]
local data = templ[i+1]
if type(data) == 'function' then
item = iup.item{title = label}
item.action = data
elseif type(data) == 'nil' then
item = iup.separator{}
else
item = iup.submenu {iupx.menu(data); title = label}
end
table.insert(items,item)
end
return iup.menu(items)
end
function iupx.show_dialog (tbl)
local dlg = iup.dialog(tbl)
dlg:show()
iup.MainLoop()
end
function iupx.GetString (title,prompt,default)
return iup.GetParam(title, nil,prompt.." %s\n",default or "")
end
function iupx.pplot (tbl)
require("iupxpplot")
return iupxpplot.pplot(tbl)
end
require("iupluacontrols")
function quit()
os.exit()
end
local ctrl1 = iup.olecontrol{"Shell.Explorer"}
ctrl1:CreateLuaCOM()
ctrl1.designmode = "NO"
ctrl1.com:Navigate("www.google.com")
local ctrl2 = iup.olecontrol{"Shell.Explorer"}
ctrl2:CreateLuaCOM()
ctrl2.designmode = "NO"
local ctrl3 = iup.olecontrol{"Shell.Explorer"}
ctrl3:CreateLuaCOM()
ctrl3.designmode = "NO"
local ctrl4 = iup.olecontrol{"Shell.Explorer"}
ctrl4:CreateLuaCOM()
ctrl4.designmode = "NO"
local ctrl5 = iup.olecontrol{"Shell.Explorer"}
ctrl5:CreateLuaCOM()
ctrl5.designmode = "NO"
local ctrl6 = iup.olecontrol{"Shell.Explorer"}
ctrl6:CreateLuaCOM()
ctrl6.designmode = "NO"
local ctrl7 = iup.olecontrol{"Shell.Explorer"}
ctrl7:CreateLuaCOM()
ctrl7.designmode = "NO"
local ctrl8 = iup.olecontrol{"Shell.Explorer"}
ctrl8:CreateLuaCOM()
ctrl8.designmode = "NO"
local ctrl9 = iup.olecontrol{"Shell.Explorer"}
ctrl9:CreateLuaCOM()
ctrl9.designmode = "NO"
local ctrl10 = iup.olecontrol{"Shell.Explorer"}
ctrl10:CreateLuaCOM()
ctrl10.designmode = "NO"
local bar1 = iup.text {expand = "HORIZONTAL",tip = "Address box",}
local bar2 = iup.text {expand = "HORIZONTAL",tip = "Address box",}
local bar3 = iup.text {expand = "HORIZONTAL",tip = "Address box",}
local bar4 = iup.text {expand = "HORIZONTAL",tip = "Address box",}
local bar5 = iup.text {expand = "HORIZONTAL",tip = "Address box",}
local bar6 = iup.text {expand = "HORIZONTAL",tip = "Address box",}
local bar7 = iup.text {expand = "HORIZONTAL",tip = "Address box",}
local bar8 = iup.text {expand = "HORIZONTAL",tip = "Address box",}
local bar9 = iup.text {expand = "HORIZONTAL",tip = "Address box",}
local bar10 = iup.text {expand = "HORIZONTAL",tip = "Address box",}
local dash = " ------------------------------------------------------------------------"
about = dash .. "\n Simple Web Browser v1.0\n Coded by Noize at www.hackcommunity.com\n Language: Lua 5.1\n\n You are allowed to edit and give away the\n source code as long as you give credits.\n" .. dash
tab1 = iup.vbox {iup.hbox {bar1,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl1.com:Navigate(bar1.value) end}},tabtitle = "Tab 1",ctrl1,}
tab2 = iup.vbox {iup.hbox {bar2,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl2.com:Navigate(bar2.value) end}},tabtitle = "Tab 2",ctrl2,}
tab3 = iup.vbox {iup.hbox {bar3,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl3.com:Navigate(bar3.value) end}},tabtitle = "Tab 3",ctrl3,}
tab4 = iup.vbox {iup.hbox {bar4,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl4.com:Navigate(bar4.value) end}},tabtitle = "Tab 4",ctrl4,}
tab5 = iup.vbox {iup.hbox {bar5,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl5.com:Navigate(bar5.value) end}},tabtitle = "Tab 5",ctrl5,}
tab6 = iup.vbox {iup.hbox {bar6,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl6.com:Navigate(bar6.value) end}},tabtitle = "Tab 6",ctrl6,}
tab7 = iup.vbox {iup.hbox {bar7,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl7.com:Navigate(bar7.value) end}},tabtitle = "Tab 7",ctrl7,}
tab8 = iup.vbox {iup.hbox {bar8,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl8.com:Navigate(bar8.value) end}},tabtitle = "Tab 8",ctrl8,}
tab9 = iup.vbox {iup.hbox {bar9,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl9.com:Navigate(bar9.value) end}},tabtitle = "Tab 9",ctrl9,}
tab10 = iup.vbox {iup.hbox {bar10,iup.button {title = "Go!",tip = "Load the page",size = "45x12",action = function() ctrl1.com:Navigate(bar10.value); ctrl2.com:Navigate(bar10.value); ctrl3.com:Navigate(bar10.value); ctrl4.com:Navigate(bar10.value); ctrl5.com:Navigate(bar10.value); ctrl6.com:Navigate(bar10.value); ctrl7.com:Navigate(bar10.value); ctrl8.com:Navigate(bar10.value); ctrl9.com:Navigate(bar10.value); ctrl10.com:Navigate(bar10.value) end}},tabtitle = "CTRL tab",iup.label{expand="NO",size="0x19",title=" The navigation on this page overwhelms all the others.",},ctrl10,}
tab11 = iup.label {expand="NO",title=about,tabtitle="About",}
tabs = iup.tabs {tab1,tab2,tab3,tab4,tab5,tab6,tab7,tab8,tab9,tab10,tab11,expand="YES"}
iupx.show_dialog {tabs; title="Simple Web Browser", size="440x180"}This is just a basic script, not well coded (mainly in the source structure and optimization), but, well, that's my first Lua script. Feedback is appreciated.
Demo
Aerodark theme
Note: demonstration videos are not up to date.
Please, report any bug you encounter and I'll fix it as soon as possible.
Known bugs:
- in-built Windows file browser asks for "overwriting" before the script does; though, the script does it with fucking charme and so I've got to find a way to not let Windows ask for it;
- current directory in file browser for saving source is not the starter directory; %windir% is instead the starter directory.
My Bitcoin address: 1AtxVsSSG2Z8JfjNy9KNFDUN6haeKr7LiP
Give me money by visiting www.google.com here: http://coin-ads.com/6Ol83U
If you want a Bitcoin URL shortener/advertiser, please, use this referral: http://coin-ads.com/register.php?refid=noize
Give me money by visiting www.google.com here: http://coin-ads.com/6Ol83U
If you want a Bitcoin URL shortener/advertiser, please, use this referral: http://coin-ads.com/register.php?refid=noize

![[+]](https://sinister.li/images/modern/collapse_collapsed.png)


