Im going to assume this is the code used to run websites
function sapphInt.getSite(paste)
responce = sapphInt.getSiteStr(paste)
if responce then
return loadstring(responce.readAll())
else
return false
end
end
loadstring runs in the global environment(_G), so unless you disabled fs globally, it's still acessible.
I did a quite thorough sandboxing recently, which you can have a look at
local tDisabled = { --disabled APIs and functions, edit them if you wish...
fs = true,
term = true,
turtle = true,
loadfile = true,
dofile = true,
io = true,
paintutils = true,
window = true,
shell = true,
multishell = true,
print = true,
write = true
}
local disabled_G = {}
for k,v in pairs(_G) do
if tDisabled[k] then
disabled_G[k] = (
type(v) == "table"
and setmetatable(
{},
{
__index = function()
error(k.." functions are disabled within the code tool!",2)
end
}
)
) or (
function()
error(k.." is disabled within the code tool!",2)
end
)
elseif type(v) == "table" then
disabled_G[k] = setmetatable({},{__index = v})
end
end
disabled_G.getfenv = function(level)
local env = getfenv(level)
if env == progEnv
or env == disabled_G
or env == _G then
return codeEnv
end
return env
end
setmetatable(
codeEnv,
{
__index = setmetatable(
disabled_G,
{
__index = _G,
__metatable = {}
}
),
__metatable = codeEnv
}
)
codeEnv._G = codeEnv
setfenv(loadedFunc,codeEnv)
Setfenv simply changes the environment of a given function or the current execution environment. So what you have to do, is create your own environment which the web pages have access to. Then you have to make sure they can't access the functions you don't want them to access from there, while still being able to access the ones you want them to.
os.queueEvent could easily be locally modified to ignore mouse clicks.