Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

Browser:GetMainFrame() returns userdata with no metatable #3

Closed
stof-soft opened this issue May 9, 2020 · 1 comment
Closed

Browser:GetMainFrame() returns userdata with no metatable #3

stof-soft opened this issue May 9, 2020 · 1 comment

Comments

@stof-soft
Copy link

stof-soft commented May 9, 2020

Hi ,
I Implimented luacef in my project
But when I try to get Frame via
browser:GetMainFrame()
or
browser:Frame(0)
browser:Frame(1)
browser:Frame(2)
or
browser:GetFocusedFrame()

it returns userdata without any methods

details :
local frame = browser:GetMainFrame()
frame:GetURL() --> attempt to index a userdata value (local 'frame')

for k , v in pairs( getmettable( frame ) ) print(k) end
-->bad argument #1 to 'for iterator' (table expected, got nil)

Thanks in advance for this great project;

@stof-soft stof-soft changed the title Browser:GetMainFrame() return userdata with no metatable Browser:GetMainFrame() returns userdata with no metatable May 9, 2020
@nomi-san
Copy link
Owner

nomi-san commented May 12, 2020

To use CefFrame, please add luacef_Frame_reg in luaopen_luacef function:

// luacef.c
EXPORT(int) luaopen_luacef(lua_State* L) {
...
    luacef_handler_reg(L);
    luacef_types_reg(L);
    luacef_funcs_reg(L);
+   luacef_Frame_reg(L);
...
}

Btw, this project is unstable, I just write for fun.
The reborn branch is new implementation, written in C++. I'll continue it soon.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants