In Swagger UI, how to open the response in a new window? - swagger-ui

Is there any way that I could open in a new window the response when I press the "execute" button in Swagger UI?
I get an HTML page response, so I would like to open it and see the message in a new window, as a webpage.
Looking into the swagger-ui-bundle, there's a newWindow variable that I guess is for that, but looking into the documentation I see just nothing.

Related

Can you use AddEventListener with CEF4Delphi?

I am using Delphi XE2 and Chromium CEF4Delphi. I am trying to use a web page via the TChromiumWindow component and would like to detect when an element is selected / clicked.
I saw this post..
Delphi Chromium - launch a command in Delphi application when button in web page is clicked by user
Unfortunately, I cant find the function AddEventListenerProc in the CEF4Delphi library. Neither can I find an alternative way to monitor a button / element click.
I would like to use the TChromiumWindow component to act as a "fron-end" to my app and would like to monitor user button clicks etc.
Can anyone help please ? I did try the developer forum but I dont see much activity there and was unable to register.
Many thanks..
The DCEF3 project has a group here : https://groups.google.com/forum/#!forum/delphichromiumembedded
But the CEF4Delphi and OldCEF4Delphi projects have a developers forum here :
https://www.briskbard.com/forum/
That forum has new posts almost every day and I try to answer them as soon as I can, usually in less than 24 hours.
If you have problems creating an account just send me a message and I'll activate your account manually.
The link you posted is very old and many things have changed in CEF since 2012.
There are several ways to detect when a HTML element has been selected, clicked, etc.
You can use a JavaScript event like "onclick" that calls a custom JavaScript extension. That extension would send a process message to the browser process to notify that the user clicked that element.
You can also use the GlobalCEFApp.OnFocusedNodeChanged that is triggered when an HTML element has been focused. This event is executed in the "render" process so you will also need to send a process message to the main browser process that the focused element has changed.
Use the JSRTTIExtension or the JSExtension demos as a template for your app.
They show you how to set a "mouseover" event that calls the "myextension.mouseover" function defined in a custom JS extension. The myextension.mouseover function executes Delphi code and sends a process message to the main browser process with some HTML information that is shown in the status bar.
They also have an example for a "MutationObserver" that calls a generic "myextension.sendresulttobrowser" function in the JS extension that sends the "value" attribute to the browser process.
Build the demo and right-click on the web page when it's fully loaded. Then select the "Set mouseover event" or "Add mutation observer" options to test what I described.

How to create a link to directly edit a SharePoint list item

I have a SharePoint online 2016 site, with a List. Now i want to have a URL (build in MS Flow) that will point directly to a specific item in Edit mode.
Meaning to have this view (both list behind and right "popup" screen):
And not like this (Copy link url)
I am able to have it opened in full screen but not like the screenshot.
Can anyone tell me if this is even possible?
I have looked into these:
http://mmkhome.blogspot.com/2010/12/sharepoint-edit-page-url-querystring.html
http://blogbaris.blogspot.com/2012/09/open-sharepoint-2010-display-edit-new.html
https://social.msdn.microsoft.com/Forums/en-US/c27e2cdd-bddb-473c-9782-0309e026204f/to-show-a-editform-in-dialog-box?forum=sharepointcustomizationprevious
https://www.spcnl.nl/redirect-link-to-item-url-from-out-microsoft-flow-to-editform-instead-of-displayform/
and tried literally everything suggested in all these links but no luck.
Things like:
Web URL/Lists/List Name/AllItems.aspx?displaymode=design
Web URL/Lists/List Name/EditForm.aspx?ID={List item ID}
/DispForm.aspx?ID=...
/EditForm.aspx?ID=...
?ID=123&pagemode=edit
?ID=123&mode=edit
PageType=4
Any suggestion is greatly appreciated!
Devtools shows that after clicking on "Edit" button above list name (the way you open this extended edit menu from first screenshoot), a REST API call is fired:
https://tenant.sharepoint.com/sites/test_site/
_api/web/GetList(%27%2Fsites%2Ftest%5Fsite%2FLists%2Ftest%5Flist%27)
/RenderExtendedListFormData(itemId=4,formId='editform',mode='2',options=15,cutoffVersion=0)
And that's it - RenderExtendedListFormData method fetch data and later, I guess, JavaScript does the rest of magic and slides out the edit menu.
To sum up: I am afriad it will be not possible using only pure URL.

Branch LiveView Shows links triggering on page load

In liveview > links, deeplinks are showing up whenever I land on a page. I would expect them to only show up on click. Is this generic behavior?
Edit: This also seems to only be happening with UTM parameters.
On the Liveview Events, select from the dropdown the event that you would like to see(e.g. CLICK or INSTALL or OPEN). The Liveview > Links show only the live data of link creation.
Refer to this document for more: https://docs.branch.io/pages/exports/pba-liveview/#liveview. For any further questions, please reach out to integrations#branch.io.

Retrieve the request data from URI in Webview Windows 8.1

I'm developing a Windows phone 8.1 app and there's this scenario where I should open the webview for the user to enter the card details. Once the card details are entered and processed, the payment API will send the transaction details back as a POST request to the webview. I'm not able to get the POST data, tried so many methods.
How do I get the post data returned back from the server? Thanks in Advance
If you have access to webpage code then you can use WebBrowser.ScriptNotify for transfering data from webpage to WP
Found a way to do this, actually the Server POST request had all the arguments in the Querystring itself
Handled the Navigation_Completed event of the webview, the args URI will have all the details required
Answer for UWP.
Important Note: I have html document locally in localcache folder. I open it in webview using ms-appdata:// scheme.
Story of infinite troubles (may be it some you some time):
If I sent the POST request, I got nothing. I get WebView_NavigationStarting event, but the Uri only was transferred. No POST data.
I try to debug using alert. Just to realize that alert doesn't work in WebView.
I found the fix that makes alert works using ScriptNotify events. Just to realize that ScriptNotify doesn't work with ms-appdata:// scheme. So the fix didn't work as well.
I learned how debug in VS by going to Project settings / Debug / Debugger type / Application process and select "Script". Then I realized that I can't put breakpoints in script in Visual Studio. And then I found a little hack -- put the word "debugger;" in your javascript code and VS will stop there. And you can debug using F10/F11. Oh, yeah, baby!
Then I finally gave up and changed it to GET request. Just to realize that it only works until form data exceed ~2K. After that nothing. NavigationStarting never fired, just nothing happens.
Finally, here the solution:
private async void WebView_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args)
{
string result = await this.WebView.InvokeScriptAsync("eval", new string[] { "$('form').serialize()" });
}
Not really elegant, but it works!!! And I was able to transfer 20K+ this way. This is exactly what I needed.

Selenium IDE simulate press ENTER for javascript configmation box

I am looking for allready for hours how to do this. So don't tell me to use search function. I know there are many things related.
There is many stuff on the internet and here, but no one works for me.
And I need a solution for Selenium IDE or something intergrated with it (if there is anything). Not RC and not WebDriver etc.
I need to simulate a key for an JavaScript confirmation popup, which has "OK" and "Cancel" buttons.
The problem is that I cannot select anything.
Popup appears when the site is opened. The Website itself is visible in the background, but no element can be selected (Firebug shows nothing as well, empty html(?)).
If I press ENTER key the confirmation box disappear (so it works fine manually).
This example seems good, but I can't find any interface in Selenium IDE to do this:
driver.switchTo().alert().accept();
(from Click in OK button inside an Alert (Selenium IDE))
I have only the following pattern:
Or write the test in html, which uses the "Command", "Target", "Value" pattern.
Appreciate any help.
EDIT1:
With the link provided by Janesh Kodikara
I have found that my problem is:
Selenium IDE will not be able to handle alerts that are within the page's onload() function. It will only be able to handle alerts that are generated after the page has completely loaded.
There is no "onload" function in my website, but the script part which creates the alert is inside html which is called with page (not in any function). This must be the same as "onload", because the alert comes immediately when the website is opened.
Once you have a confirmation box, you must consume it (Click OK or Cancel button)
You can use "chooseOkOnNextConfirmation" command to instruct Selenium IDE to simulate clicking OK button.
See http://www.guru99.com/enhancing-selenium-ide-script.html for more details.
You will not see the Javascript popup when IDE script is run.
Selenium IDE
Command : runScript
target : {window.onbeforeunload=function(e){};}
Command :click
target : xpath of button.
This will work fine but you are not able to see popup.

Resources