<
От версии < 6.2 >
отредактировано Alexandr Fokin
на 2022/12/08 08:33
К версии < 6.3 >
отредактировано Alexandr Fokin
на 2022/12/08 08:34
>
Изменить комментарий: К данной версии нет комментариев

Комментарий

Подробности

Свойства страницы
Содержимое
... ... @@ -1,41 +1,8 @@
1 1  GeckoFX
2 2  [[https:~~/~~/www.nuget.org/packages/GeckoFX/>>url:https://www.nuget.org/packages/GeckoFX/]]
3 3  
4 -
5 5  ----
6 6  
6 +{{children/}}
7 7  
8 -{{code language="c#"}}
9 -
10 -// Change html attribute
11 - var usernameInput = geckoWebBrowser1.Document.GetElementById("j_username");
12 - usernameInput.SetAttribute("value", "abc");
13 -
14 -
15 -// ButtonClick
16 - var buttonElement = geckoWebBrowser1.Document.GetElementById("button");
17 - new GeckoButtonElement(buttonElement.DOMElement).Click();
18 -
19 -
20 -// FormSubmit
21 - var form = geckoWebBrowser1.Document.GetElementById("loginForm");
22 - (form as GeckoFormElement).submit();
23 -
24 -
25 -// Execute JS
26 - using (AutoJSContext context = new AutoJSContext(geckoWebBrowser1.Window))
27 - {
28 - var result1 = context.EvaluateScript(
29 - "(() => { return 2; })()",
30 - (nsISupports)geckoWebBrowser1.Window.DomWindow,
31 - out res
32 - );
33 -
34 - var result2 = context.EvaluateScript(
35 - "document.getElementById('loginForm').submit()",
36 - (nsISupports)geckoWebBrowser1.Window.DomWindow,
37 - out res
38 - );
39 - }
40 -
41 -{{/code}}
8 +