<
От версии < 3.1 >
отредактировано Alexandr Fokin
на 2021/08/12 10:55
К версии < 6.4 >
отредактировано Alexandr Fokin
на 2022/12/08 08:34
>
Изменить комментарий: Удаленный объект

Комментарий

Подробности

Свойства страницы
Содержимое
... ... @@ -1,39 +1,8 @@
1 -priyank/GeckoFX
2 -https://github.com/priyank/GeckoFX
1 +GeckoFX
2 +[[https:~~/~~/www.nuget.org/packages/GeckoFX/>>url:https://www.nuget.org/packages/GeckoFX/]]
3 3  
4 +----
4 4  
6 +{{children/}}
5 5  
6 -{{code language="c#"}}
7 -
8 -// Change html attribute
9 - var usernameInput = geckoWebBrowser1.Document.GetElementById("j_username");
10 - usernameInput.SetAttribute("value", "abc");
11 -
12 -
13 -// ButtonClick
14 - var buttonElement = geckoWebBrowser1.Document.GetElementById("button");
15 - new GeckoButtonElement(buttonElement.DOMElement).Click();
16 -
17 -
18 -// FormSubmit
19 - var form = geckoWebBrowser1.Document.GetElementById("loginForm");
20 - (form as GeckoFormElement).submit();
21 -
22 -
23 -// Execute JS
24 - using (AutoJSContext context = new AutoJSContext(geckoWebBrowser1.Window))
25 - {
26 - var result1 = context.EvaluateScript(
27 - "(() => { return 2; })()",
28 - (nsISupports)geckoWebBrowser1.Window.DomWindow,
29 - out res
30 - );
31 -
32 - var result2 = context.EvaluateScript(
33 - "document.getElementById('loginForm').submit()",
34 - (nsISupports)geckoWebBrowser1.Window.DomWindow,
35 - out res
36 - );
37 - }
38 -
39 -{{/code}}
8 +
XWiki.XWikiComments[0]
Комментарий
... ... @@ -1,8 +1,7 @@
1 -geckofx button click
2 -https://stackoverflow.com/questions/15005216/geckofx-button-click
1 +Geckofx60.64
2 +https://www.nuget.org/packages/Geckofx60.64/
3 3  
4 -Submit web form on a GeckoWebBrowser? (GeckoFX)
5 -https://stackoverflow.com/questions/20755971/submit-web-form-on-a-geckowebbrowser-geckofx
6 -
7 -Gecko 45 c# winform add script to document
8 -https://stackoverflow.com/questions/34993941/gecko-45-c-sharp-winform-add-script-to-document
4 +Запуск:
5 +1) Создать проект
6 +2) Выставить для проекта разрядность x64
7 +3) В точке входа вызвать Xpcom.Initialize("Firefox64");