Comments (4)
verified
Original comment by [email protected]
on 6 Aug 2013 at 1:14
from dcef3.
Strangely, BUT this code work fine:
// .....
type
TMyExtension = class(TThread) // or just class, (extension code execute in thread)
class function call(const arg1, arg2: ICefv8Value): string;
end;
TCustomRenderProcessHandler = class(TCefRenderProcessHandlerOwn)
protected
procedure OnWebKitInitialized; override;
end;
implementation
// .....
procedure TCustomRenderProcessHandler.OnWebKitInitialized;
begin
{In webPage <script> alert( MyEXT.call('arg1', 'arg2') ); <script>}
TCefRTTIExtension.Register('MyEXT', TMyExtension);
end;
class function TMyExtension.call;
begin
// some code
result := 'result from Delphi XE2: ' + arg1.GetStringValue;
end
initialization
CefRenderProcessHandler := TCustomRenderProcessHandler.Create;
end.
-------------------------------------------
To add MyEXT.SomeAnotherFunc() in js, just add
class function TMyExtension.SomeAnotherFunc;
Original comment by [email protected]
on 6 Aug 2013 at 5:36
from dcef3.
And I think this is more scalable than using CefRegisterExtension.
The issue may be closed.
Original comment by [email protected]
on 6 Aug 2013 at 5:47
from dcef3.
class function hello: ICefv8value;
ret := TCefv8ValueRef.NewArray(2);
ret.SetValueByIndex(0,TCefv8ValueRef.NewString('qwe'));
ret.SetValueByIndex(1,TCefv8ValueRef.NewString('asd'));
result := TCefv8ValueRef.NewObject(nil);
result.SetUserData(ret);
on return empty object
Original comment by [email protected]
on 21 Aug 2014 at 4:53
from dcef3.
Related Issues (20)
- Geo Location issue HOT 1
- In FireMonkey Can not show <Select> Tags and Popup. HOT 1
- Update FMX Resizing HOT 1
- return object to javascript variable HOT 1
- ChromiumFMX does not show any context menu in firemonkey HOT 1
- TCefRTTIExtension HOT 1
- How to clear history in dcef3 ? HOT 1
- Excel file open delay Issue HOT 4
- The function TCefListValueRef.New always returns nil HOT 2
- cef3 does not render on XE5. Page is blank. HOT 4
- Ask for src code of Delphi Chromium Embedded 3 HOT 1
- delphi xe5 compiling optimization bug
- Timepicker not working properly HOT 1
- TChromium causes issues with main form OnCreate / OnActivate.
- cef.inc up to XE7 HOT 1
- onGetCookieManager is not called HOT 3
- cefvcl lacks onCertificateError property HOT 1
- Memory Leaks HOT 1
- DCEF3 javascript window.close in MDI app closes not only MDI child but whole app
- CefBrowser.ClearHistory method
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dcef3.