Coder Social home page Coder Social logo

luacef's Introduction

Halo ๐Ÿ‘

  • ๐Ÿคฃ Full-stack system to web
  • ๐Ÿฅณ Reverse engineering
  • ๐ŸŸ Fishing


Visitor count

luacef's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

luacef's Issues

V8Value.CreateBool(): value stored incorrectly

The following code return false:

cef.V8Value.CreateBool(true):GetBoolValue()

This is due to the way it's stored by this function:

static int luacef_v8value_create_bool(lua_State* L) {
    int i = lua_tointeger(L, 1);

    cef_v8value_t* p = cef_v8value_create_bool(i);

    luacef_pushuserdata(L, p, __v8value__);
    return 1;
}

It should be lua_toboolean(L, 1) instead of lua_tointeger(L, 1).

error: The specified procedure could not be found.

Platform: Windows 10 x64
GCC: version 7.3.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)
Lua: 5.3 x64

The project builds successfully (after changing 'luacef_frame_reg' to 'luacef_Frame_reg' on line 316),
but running the lua code in readme hangs at the first line with error:

C:\lua\lua53.exe: error loading module 'luacef' from file '.\luacef.dll':
        The specified procedure could not be found.

stack traceback:
        [C]: in ?
        [C]: in function 'require'
        .\test.lua:1: in main chunk
        [C]: in ?

Both the lua code and 'luacef.dll' are in the 'Release' folder of 'cef-minimal'.

Browser:GetMainFrame() returns userdata with no metatable

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;

Implement reference counting

All classes from C++ is provided to Lua by using metatable, so they can be freed after called collectgarbage() multiple times. My old way is too bad, may lead to crash.

client = newClient();
callback = function(client, some_args)
    client = nil;
end
client:reg(callback);

In this example, the client object is one, but can be freed twice.

CEF is written in C++, almost classes that inherited CefBase contain virtual methods too.
That helps we override them, in CAPI easily.

luacef/src/luacef.h

Lines 118 to 123 in 7a5eee5

#define IMPL_REFCOUNT_MEMBER() int _rc
#define IMPL_REFCOUNT_METHODS(T) \
static void \
CEF_CALLBACK T##_base_add_ref(T* self) \
{ \

luacef/src/base/app.c

Lines 28 to 34 in 7a5eee5

IMPL_REFCOUNT_MEMBER();
} luacef_App;
IMPL_REFCOUNT_METHODS(luacef_App);

luacef/src/base/app.c

Lines 188 to 198 in 7a5eee5

static int App__gc(lua_State* L)
{
if (lua_isnoneornil(L, 1)) return 0;
void **ud = (void**)lua_touserdata(L, 1);
if (ud && *ud) {
luacef_App *p = *ud;
p->base.release((void*)p);
}
return 0;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.