I have a microsoft Teams tab application. I would like to print an svg image from this tab (generated on the client)
Normally, this is done by opening a new window and constructing a document to print there (I want to print a generated svg picture)
But in teams client, this option is disabled as opening popups is prohibited by the client.
I have tried some workarounds to open popups mentioned here to no avail:
using microsoftTeams.tasks.startTask to open a popup and try printing from there (does not load because the file is not located on the server at all, it is generated on the client). Maybe this can be still done somehow?
microsoftTeams.authentication.authenticate to open a new window. Downloads the content instead of opening it.
We have methods to enable print for the entire tab. You can use the following- microsoftTeams.enablePrintCapability() and microsoftTeams.print().
Related
Using Firefox 70.0.1 on Arch Linux. (I realize that this question might technically belong on SuperUser, but I suspect that no non-developer would ever need to do this.)
I'm trying to debug my code that generates an RSS feed, by viewing it directly in Firefox's XML viewer.
When I enter a feed URL, like https://en.blog.wordpress.com/feed/, Firefox pops up the dialog that asks me what to do with the file. It calls it an "RSS Summary", and I can choose to open it or save it to disk.
I can choose to open it in Firefox, but then the file is first downloaded to disk, and then opened from a file:// URL. The result is that I can't hit F5 to refresh it; I have to enter the URL anew.
This only happens if the Content-Type header is application/rss+xml. A file served up as plain application/xml (like e.g. https://xkcd.com/rss.xml uses) is opened directly.
How can I tell Firefox that application/rss+xml should receive the same treatment and just be viewed as a regular XML file?
Add the „view-source:“ prefix in front of your url as said in this article: https://css-tricks.com/snippets/html/view-source-of-rss-feed-in-firefox/
You should be able to achieve this using an extension.
There is Open in Browser which seems to resolve the issue.
When you try opening the RSS URL with the extension installed, you will be shown a window where you can choose which action to take. You can choose to open the file as XML in the browser window. If you want to be able to hit F5 and reload the file, you may also want to tick "Do this automatically for files like this from now on".
Note that I haven't read the source code of the extension so I don't know if it is safe to use or not.
I'm using MooTools as JS-Framework.
When a user clicks the "Show Report"-Button on my website I'm starting Request.HTML to retrieve the path of the requested report.
If the report does not exists yet, its been created on the server (a waiting popup is shown to the user). The report file is saved to a special path on the server and this path is returned to the browser.
After I got the path to the Report-File - the Report can reach about 5 to 8MB - I want to show the user a "Download-ProgressBar" while starting a new Request.HTML to retrieve the big report file.
Everthing until this point works fine. I got the ProgressBar filling up, after its finished I got my big file.
But my problem is now, how I can start something like "Open File" or "Save File As" from JavaScript.
I got the freaking file downloaded and shown in the console but now I want the user to save this file somewhere or to open it directly...
Kind Regard.
Why don't just show a link to that file so that it opens in a new page?
That way one can open in a new window and save from the browser's menu (or use the right click>save to menu).
Since you already have your file serialized most browsers nowadays supports the data uri scheme so if this fine to support a limited subset of browsers you can do
window.open(fileToSave, '_blank');
notably old version of IE don't support all kind of files using data-uri so it will not work for html.
There are some File API in newer browser too, and there are some other solutions involving flash but historically the right way to do this is to navigate to a server page which returns an header
Content-Disposition: attachment; filename=yourfilename.html
that will work in any browser (I used this a lot in IE6 with no particular problem).
Problem: Need to read/capture the text of Windows pop-up messages that is generated by non-VB applications.
Situation:
I've a VB6 app, part of which requires processing an excel workbook. A non vb-6 pop-up window (as attached screen) "FILE CONVERSION IN PROGRESS" comes up, while opening an new version of excel-sheet from an old MS Excel app. And automatically it closes alos.
Requirement: I want to capture that pop-up occurance in the code. And then write a conditional statement code for the 'cancel' button click event of that non vb-6 pop-up.
Can anyone suggest something?
You can access other applications with the following APIs:
FindWindow() to locate the main window of what you're looking for
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633499%28v=vs.85%29.aspx
GetWindow() to navigate through the HWNDs of the application so you can get to the button
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633515%28v=vs.85%29.aspx
GetWindowText() to access the text from a control (it cannot be an Edit control)
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633520%28v=vs.85%29.aspx
You'll want to use Spy++ (which can be downloaded) to see what the class name you're looking for when it comes up and to figure out the hierarchy to navigate properly.
You'll need to use the API Text Viewer to get the API declarations so you can use them in VB6 properly.
I need to open multiple tabs within a single browser and i need switch over all the tabs.
Give me your suggestions. Thanks in advance.
I'm not so strong in capybara. so, i'm giving solution to switch over between tabs using selenium.
For a instance you clicks a button in a web page and it will open a new page.
The new page may open in a new tab in the same browser window or in a new browser window. That is not controlled by selenium. It will control by the browser which you using.
For a instance take firefox, goto tools->ptions-> tabs-> open new windows in a new tab instead check the option. For example, if you clicks a button it will opens a page only in the new tab of a same browser window. For a sake if you unchecked mean it will open a page in the new browser window. Likewise every browser has its own settings.
Try this code:
new Actions(driver)
.sendKeys(driver.findElement(By.tagName("html")), Keys.CONTROL)
.sendKeys(driver.findElement(By.tagName("html")), Keys.NUMPAD2)
.build().perform();
In above Keys.NUMPAD2 refers that you are gonna move to the second tab in the session.
You can move to Third, Fourth, etc... by giving NUMPAD3, NUMPAD4, etc... respectively. Here i am using windows OS, if you are in some other OS use their shortcuts.
I hope this will help you.
You can use this exact function in Ruby:
page.driver.browser.switch_to.window(page.driver.browser.window_handles.last)
I downloaded the spring mvc petclinic, when I run it, and clicked in the link :
Display all vitiranians
I got a pop up dilog box saying :
Do you want to save this file, or find a program online to open it ?
in the controller that link is defined like this :
#RequestMapping("/vets")
public ModelMap vetsHandler() {
Vets vets = new Vets();
vets.getVetList().addAll(this.clinic.getVets());
return new ModelMap(vets);
}
My question is :
why it does not dsplay vitiranians and just propmpt me withat dialog box ?
any idea or help will be appreciated.
thanks
The application to be used to open a content of a certain type can be customized in some browsers (I know only for Mozilla and Opera):
Mozilla Firefox users
Open Mozilla Firefox
Click Tools and then Options
Within the Options window click Applications
Select the Content Type you wish to adjust. For example, if you want
to change how a .PDF file opens in Firefox, select Adobe Acrobat Document.
In the Action section, change the action to how you wish to open the
file. If you want to download .PDF files instead of opening them,
select Save file.
Opera users
Open Opera
Click Tools and then Preferences
In the Advanced tab click Downloads
Locate and highlight the file extension you wish to adjust. For
example, pdf (or application/pdf). Tip: You can sort these columns.
Once highlighted, click the Edit button.
Within the file type window, specify how you wish for the file to be
handled.