LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI snippets and firefox

Solved!
Go to solution

When I try to drag a VI snippet from webpage with firefox LabVIEW displays a comment with the URL of the PNG file.

If I switch to IE I get the actual snippet loaded into LabVIEW.

Does anyone know a solution?

 

Firefox 3.5.2

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 1 of 13
(6,601 Views)

The linked article and accompanying video clearly states it only works as drag and drop from IE and windows Explorer.

 

Sorry,

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 13
(6,585 Views)

Eh? That's weak.

 

So a windows-only feature (and not all Windows users at that) for drag-and-drop?

 

Shane.

0 Kudos
Message 3 of 13
(6,579 Views)

Hello,

There are a couple of workarounds for Firefox:

- Drag and drop the image to the desktop first, and then drag and drop into LabVIEW 2009 (officially recommended method)

- Downgrade your version of Firefox to around 2.0 (I am not suggesting NI supports this, it is just a personal observation), and you should be able to drag and drop straight into LabVIEW 2009.

 

Here is the version I used that worked:

 

oldFirefox.PNG

Message Edited by macaba on 08-07-2009 05:32 AM
Message 4 of 13
(6,571 Views)

Hi. I developed the VI Snippet feature, and the problem you are running in to was a frustrating one. It has to do with the choices Firefox and Internet Explorer made to implement drag-dropping images from their applications.  When you drag from your web browser to another application, the second application is given what Firefox or IE chooses to give.  IE will give the receiving program a file system path to a local copy of the image (in your temporary directory). This allows for immediate access to that image by LabVIEW. Firefox will provide, not a copy of the image being dragged, but a URL to where that image can be obtained on the internet for download, even though Firefox itself has just downloaded it. 

 

We looked in to immediately downloading files at URLs that are dragged in to LabVIEW (with no guarantee that the URL contains a snippet at the end of it), but chose not to for a number of reasons. First, you may have downloaded a page in Firefox completely, then, lost or unplugged your internet connection, and then tried to drag your image from Firefox to LabVIEW. LabVIEW would (in the hypothetical case we investigated) try to, and fail to, download the VI Snippet image (because you don't have an internet connection). This failure is difficult for users to understand, and hard to communicate well to them. Additionally, the internet connection may be slow, so we would have to lock up that LabVIEW window until their VI Snippet has dropped onto the diagram. Why would we have to lock LabVIEW? We could download the file in the background, but while it's downloading, the user is now possibly interacting more and more with their LabVIEW block diagram, and right in the middle of this, a lot of code happens to plop down right in front of them at the time the snippet happened to conclude downloading. Also, other user interface interactions (like select-all-delete) would be hard to negotiate with the fact that a user dropped a VI Snippet, but the snippet code was not yet there. Another reason we chose not to is because, when given a URL dragged from Firefox, we don't know if it's a small VI Snippet image to download or some other, random, huge file that LabVIEW would just throw away, and again communicating to users that they've dragged a URL that had a file that wasn't a VI Snippet is also confusing.  I agree it is seemingly bizzare that dragging from Firefox and Internet Explorer provide different results, and we can't help by predicting why a certain URL was dragged to LabVIEW to then help prompt the user to understand why something they didn't understand may have happened.

 

We've attempted to help mitigate this by including well described help in the VI Snippet's new feature page: http://zone.ni.com/devzone/cda/tut/p/id/9330 and in the included LabVIEW documentation.

 

For Firefox users, the suggestion is to (as mentioned above) drag the file to your local computer file system (desktop for example). This will cause the file to be saved to your computer (if, at the time of dragging you have an internet connection to the web page you want the snippet from), from which you can drag that file in to LabVIEW.

 

This was a long winded post to help share the reasons (and solutions) for why the snippet acts the way it does. We are still looking into other solutions to this for later versions of LabVIEW (no promises on what we may or may not be able to deliver), but I wanted to let you know why some choices were made and why, and that we are always trying to further innovate on our features in every new version of LabVIEW.

 

Thanks, and let me know if you have any other questions about the snippet.

 

 -Wes

Message 5 of 13
(6,514 Views)

WesReynolds wrote:

 

let me know if you have any other questions about the snippet.


We would appreciate a VI for calling this programmatically (since it's not currently exposed through VI server). There's a thread about this here.


___________________
Try to take over the world!
0 Kudos
Message 6 of 13
(6,497 Views)
Solution
Accepted by topic author TCPlomp

Ton (et al),

 

I've written a quick drop plugin that replaces the URL comment that gets added when you drag a snippet from Firefox or Chrome with the code you wanted.

 

Once installed, drag a snippet from any browser, select the text, press <ctrl-space> then <ctrl-u>.  The plugin will fetch the snippet, extract the code, and replace the text with the code.

 

To install, unzip the attached file to  ..LabVIEW 2009\resource\dialog\QuickDrop\plugins\

 

DISCLAIMER: I work for NI but I'm not a software developer (I'm a product manager).  This should not be considered NI supported code. 

Message 7 of 13
(6,461 Views)

TonP wrote:

When I try to drag a VI snippet from webpage with firefox LabVIEW displays a comment with the URL of the PNG file.

If I switch to IE I get the actual snippet loaded into LabVIEW.

Does anyone know a solution?

 

Firefox 3.5.2

 

Ton


Firefox has a plug-in called "IE Tab" that embeds the IE engine into a Firefox tab.  You can switch between Firefox and IE engines for any tab, independently, on the fly.  In IE Tab's setup, you can also designate web sites that should *always* be displayed using the IE engine.  It's good enough to work with Microsoft Update, so maybe if you choose to display the tab in IE mode, it will work!

 

Bill

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 8 of 13
(6,447 Views)

billko wrote:

TonP wrote:

When I try to drag a VI snippet from webpage with firefox LabVIEW displays a comment with the URL of the PNG file.

If I switch to IE I get the actual snippet loaded into LabVIEW.

Does anyone know a solution?

 

Firefox 3.5.2

 

Ton


Firefox has a plug-in called "IE Tab" that embeds the IE engine into a Firefox tab.  You can switch between Firefox and IE engines for any tab, independently, on the fly.  In IE Tab's setup, you can also designate web sites that should *always* be displayed using the IE engine.  It's good enough to work with Microsoft Update, so maybe if you choose to display the tab in IE mode, it will work!

 

Bill


Can anyone verify that this works?  It would be far simpler to do if it worked, though technically it's not a "native" Firefox solution since it uses the actual IE engine.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 13
(6,382 Views)

billko wrote:

billko wrote:

TonP wrote:

When I try to drag a VI snippet from webpage with firefox LabVIEW displays a comment with the URL of the PNG file.

If I switch to IE I get the actual snippet loaded into LabVIEW.

Does anyone know a solution?

 

Firefox 3.5.2

 

Ton


Firefox has a plug-in called "IE Tab" that embeds the IE engine into a Firefox tab.  You can switch between Firefox and IE engines for any tab, independently, on the fly.  In IE Tab's setup, you can also designate web sites that should *always* be displayed using the IE engine.  It's good enough to work with Microsoft Update, so maybe if you choose to display the tab in IE mode, it will work!

 

Bill


Can anyone verify that this works?  It would be far simpler to do if it worked, though technically it's not a "native" Firefox solution since it uses the actual IE engine.


I can verify this works:

 

ietab.PNG

 

Then drag and drop example snippet into LabVIEW 2009:

 

 droppedSnippet.PNG

0 Kudos
Message 10 of 13
(6,324 Views)