roblox

Loading iframe in google-chrome extension (Error: Protocols must match)

纵饮孤独 提交于 2019-12-04 21:21:30
Code in manifest.json: { "name": "Test", "version": "1.0", "manifest_version": 2, "description": "Test", "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html" }, "permissions": [ "notifications", "https://www.roblox.com" ], "background": { "scripts": ["background.js"] }, "content_security_policy": "script-src https://www.roblox.com 'self' ; object-src 'self'", "web_accessible_resources": [ "icon.png" ] } Code in background.js: var iframe = document.createElement("iframe") iframe.src = "http://www.roblox.com/User.aspx?ID=1" document.body.appendChild(iframe) I keep

Creating a secure Lua sandbox..?

时间秒杀一切 提交于 2019-12-02 12:49:17
Right now I am doing a lot of. local env = { print = print, } setfenv(func, env) and then using metamethods to lock propertys on Instances, but it is really inefficient and has lots of bypasses. I googled it and everything I find is the same as this: unworking. In Lua 5.1, sandboxing is pretty simple. If you have a Lua script in a file somewhere, and you want to prevent it from accessing any functions or anything other than the parameters you provide, you do this: local script = --Load the script via whatever means. DO NOT RUN IT YET! setfenv(script, {}) script is now sandboxed. It cannot

How does an object reference itself in Lua?

£可爱£侵袭症+ 提交于 2019-12-01 16:53:58
问题 C# has this and VB has ME . What is the Lua equivalent? I am trying to reference the parent of the script class in Roblox. 回答1: From the Lua documentation section 2.5.9, the self reference is usually self : The colon syntax is used for defining methods, that is, functions that have an implicit extra parameter self . Thus, the statement function t.a.b.c:f (params) body end is syntactic sugar for t.a.b.c.f = function (self, params) body end 回答2: As Greg pointed out already, the name you are

How does an object reference itself in Lua?

我的梦境 提交于 2019-12-01 16:50:50
C# has this and VB has ME . What is the Lua equivalent? I am trying to reference the parent of the script class in Roblox. Greg Hewgill From the Lua documentation section 2.5.9 , the self reference is usually self : The colon syntax is used for defining methods, that is, functions that have an implicit extra parameter self . Thus, the statement function t.a.b.c:f (params) body end is syntactic sugar for t.a.b.c.f = function (self, params) body end RBerteig As Greg pointed out already , the name you are looking for is self . However, be aware that Lua is not an OOP language any more than it is