We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I using following code:
using System; using Newtonsoft.Json; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using BaristaLabs.ChromeDevTools.Runtime; using Page = BaristaLabs.ChromeDevTools.Runtime.Page; namespace BaristaChromeDevToolsTest { class Program { //Launch Chrome With //"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9223 static async Task Main(string[] args) { var sessions = await GetSessions("http://localhost:9223/"); using (var session = new ChromeSession(sessions.First(s => s.Type == "page").WebSocketDebuggerUrl)) { await session.Page.Enable(); await session.DOM.Enable(); var loaded = new SemaphoreSlim(0, 1); var inserted = new SemaphoreSlim(0, 1); session.Page.SubscribeToLoadEventFiredEvent((e) => { loaded.Release(); }); var navigateResult = await session.Page.Navigate(new Page.NavigateCommand { Url = "http://www.amazon.com" }); // await loaded.WaitAsync(); session.DOM.SubscribeToChildNodeInsertedEvent((e) => { inserted.Release(); }); await inserted.WaitAsync(); Console.WriteLine("inserted"); } Console.ReadKey(); } public static async Task<ICollection<ChromeSessionInfo>> GetSessions(string chromeUrl) { using (var webClient = new HttpClient()) { webClient.BaseAddress = new Uri(chromeUrl); var remoteSessions = await webClient.GetStringAsync("/json"); return JsonConvert.DeserializeObject<ICollection<ChromeSessionInfo>>(remoteSessions); } } } }
Next I opening devtools in this Chrome, evaluating code like such:
var el = document.createElement('div'); document.body.appendChild(el);
...and still no "inserted" in console. But if I open devtools protocol monitor, I will see DOM.childNodeInserted was called. Also: https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-childNodeInserted
DOM.childNodeInserted Mirrors DOMNodeInserted event.
If I directly subscribe DOMNodeInserted - it fires.
Propose you to write more unit tests.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I using following code:
Next I opening devtools in this Chrome, evaluating code like such:
...and still no "inserted" in console.
But if I open devtools protocol monitor, I will see DOM.childNodeInserted was called.
Also:
https://chromedevtools.github.io/devtools-protocol/tot/DOM#event-childNodeInserted
If I directly subscribe DOMNodeInserted - it fires.
Propose you to write more unit tests.
The text was updated successfully, but these errors were encountered: