问题标签 [tchromium]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
delphi - TChromium how to block middle mouse click on the links?
How to block middle mouse click on the links in TChromium?
I want to handle this middle mouse click by my own to open it in new tab, so i need to block this middle mouse click in TChromium, and then hook middle mouse, and then open selected link in new tab.
I have this default function:
But exactly it gives nothing.
TNX
delphi - TChromium LoadString - 不允许加载本地资源
如果我尝试使用 LoadString 加载页面并在其中加载资源,例如:
它没有加载这个资源,它Not allowed to load local resource
在控制台中给出错误。
问题:我需要做些什么来解决这个问题或者解决这个问题?
TNX
javascript - Simulate click on DIV
I am developing a desktop application in Delphi XE4 using TChromium component to display Google Voice webpage.
I need to start a call programmatically and I can't find a way to trigger the javascript code behind the button (it is a DIV) "CONNECT":
TChromium allows to execute javascript code and I already managed to simulate the click on "CALL" button using a javascript code that simulates the Key Event using the character "c" which display the panel. This works because Google Voice has shortcuts and "c" is a valid shortcut to start a call. Also with javascript I can set the number in the input field. My main problem is that I don't know how to simulate a click on "CONNECT":
As you can see, there is no ID, no onClick and there is no shortcut to trigger the Connect button.
I can get a reference to this DIV using the following code:
But it is not possible to trigger anything appending .click(). I assume it is because click() will trigger onClick method that it is not defined. Is there any way to know what javascript code executes when someone clicks over this div?
If the focus is in the "Number to call" input, I can press "TAB" to navigate to "Phone to call with", then to "Remember to choice" and finally to "Connect" where I can press Enter key to make it work also. I tried to use the same code as in the beginning to simulate the CALL button but this time with TAB (keycode 9 instead of 67) and it does not work as the focus does not move.
I tried to do it programmatically with delphi also using mouse_event, keybd_event, PostKeyExHWND, PostKeyEx32 and PostMessage with no results as the focus does not move away from "Number to call"
The only option that works by now is to move the mouse with delphi using SetCursorPos and simulate a click on that button calculating the coordinates but this will be my last option to choose as I would prefer a javascript code to do it.
Any suggestions are welcome!
delphi - TCefStreamReaderRef 用法
我正在尝试用本地文件替换 webbrowser 请求的数据,但结果未显示在浏览器中。那么如何正确使用TCefStreamReaderRef
呢?
delphi - 在 TChromium 中清除 Cookie
如何在CEF3.1547中清除 cookie我尝试了以下解决方案,但这根本没有任何作用。Cookie 仍然存在。还有比这更好的解决方案吗?
inno-setup - 在 Inno Setup 中创建 TChromium 时出错
我正在尝试创建一个TChromium的DLL以在Inno Setup中使用,等于用TWebBrowser制作的TLama,创建inno-web-browser,但我不能,我遵循基本程序的相同逻辑,但是在创建过程中,inno设置中的创建窗口虽然很奇怪,但留下了附件打印,显示图像。
编辑:我正在使用 Delphi XE2 和 DCEF3。
delphi - 更改 Chromium Embedded 3 (DCEF3) (CefVCL) 中的用户代理
我正在尝试修改 TChromium 的用户代理,但如果它使用 CefVCL,我发现没有任何程序。已经通过ceflib看起来必须是的,我看到一个变量“设置”接收一个值“user_agent”但是VCL已经有,会有还是不可能这样?
javascript - 如何在嵌入式 Chromium 控件中执行 JavaScript 获得结果?
如何执行 JavaScript 并在 DCEF3 中获取结果?如果有人能写一个简单的例子来说明如何做到这一点,我将不胜感激。
我可以使用下面的代码执行 JavaScript,但它不提供结果。
delphi - Chromium(Delphi):访问DOM,如何避免异步,等待页面加载?
我有点陌生TChromium
。我收集了具体的示例代码,制作了自己的测试程序。现在我遇到了一些问题,希望有人可以帮助我解决它:
首先。我习惯于OnLoadEnd
捕捉页面加载的那一刻,但它不能正常工作。至少在我下面的代码中。如何正确捕捉那一刻?
只要VisitDom
是异步的,我就无法在页面加载后和下一页将在循环内加载之前立即调用它。或者!如果每个页面都被一个一个地加载,并且VisitDom
为每个加载的页面的 DOM 快照准确地执行异步就可以了
比。脚本的类似情况(尚未在我的测试程序中实现)。在加载后的每个页面上都会执行脚本,并且 DOM 将被更改,因此我也需要对其进行解析。请帮助我解决任何解决方案:在脚本完成时捕获,然后在它完成后立即解析页面或捕获脚本并针对此脚本产生的 DOM 解析页面异步精确。
更短的周期看起来像: 加载页面
加载页面
解析这个DOM执行
脚本
执行的脚本
解析这个DOM可以在循环的时刻执行,也可以在特定时刻与确切的 DOM 异步执行
。parse DOM
简化的问题看起来像:如何捕获事件“页面加载”和“脚本完成”,以及如何访问在这个特定时刻准确生成的 DOM 快照(同步或异步)
谢谢您的帮助!