why i can't pass parameters to flash using 'file://' protocol? - linux

system info
flash player version: 10_1_102_65
OS: linux debian, 6.0.2
web browser: Mozilla Iceweasel 3.5.16
problem description
I have a flash file that uses parameters to show output on the screen. unfortunately i don't have sources and can't modify/review it.
i can successfully run flash and pass parameters to it using http:// protocol. for example,
#> iceweasel http:///localhost/40.swf?channel_id=1
shows correct flash in the browser.
but when i try to load flash from file
#> iceweasel file:///home/user/40.swf?channel_id=1
flash can't read passed parameter and shows invalid output
it's really strange. because when i downgraded flash plugin (from 10_1_102_65 to 9) both protocols works! That is something occurred in the flash player above 9.
unfortunately i can't use Flash Player 9 in my production environment so i should resolve the issue with Flash Player 10.
question
how can i pass parameters to flash using 'file://' protocol?
any help is appreciated.
thanks.

As Ignacio says, GET parameters are part of HTTP and won't work with the file:// protocol, but one thing you could try is to supply the channel_id is a a FlashVar. Internally in the swf, the ActionScript code normally access GET parameters and FlashVars the same way (using loaderInfo.parameters).

GET only exists in HTTP. You cannot use a query string when accessing a local file. And since you don't have the source, it's near impossible to provide an alternative.

Related

Selenium InvalidArgumentException on opening webpage without protocol specified (http/https)

On Windows 10 (64bit, python3.6.8), I'm unable to open link via driver's get method in case link was filled without http:// or https:// protocol specified.
I use selenium==3.141 and msedge-selenium-tools-3.141.2 with python.
Microsoft Edge version 85.0.564.51 (same as driver version).
The following code raises error:
from msedge.selenium_tools import Edge, EdgeOptions
options = EdgeOptions()
options.set_capability('platform', 'Windows')
options.use_chromium = True
path = r'<correct path to driver>'
driver = Edge(executable_path=path,
service_args=None,
options=options,
desired_capabilities={})
driver.get('google.com')
Error: selenium.common.exceptions.InvalidArgumentException: Message: invalid argument (Session info: MicrosoftEdge=85.0.564.51)
Browser state on error - browser is launched and points to data:, url.
After some investigation, I found that in case I change driver.get('google.com') to driver.get('http://google.com'), issue is not reproducible.
The main concern is, your program shouldn't be stuck with data:, in the url bar. Incase this situation happens the simplest solution would be to crosscheck the following points:
When invoking get() method passing an URL you need to pass the Fully Qualified Domain Name (FQDN). You need to ensure the url is properly formatted. As an example, the protocol i.e. http is appended along with the actual url as follows:
https://www.google.com/
Additionally, you also need to ensure that you are using compatibile version of binaries in terms of Google Chrome Browser and ChromeDriver
I agree with the suggestion given by the #DebanjanB.
When using driver.get("URL") method you need to compulsory pass the protocol with the URL.
If you do not pass the protocol then you will get an error.
The error might be a little bit different based on the programming language you are using.
I suggest you refer to this document and try to fully read it. It is for Firefox and using the JAVA language but the logic remains the same for all the browsers and all the programming languages. I hope it will help you to clear your confusion.
After I tried to run the same code on another machine, it worked pretty well without any errors. For me it looks like some issues with setup or Parallels VM I used on first machine

Access a local IBM Notes application with default system browser

I am developping web applications using the Xpages framework from the IBM Lotus Notes technology.
My users don't use the embedded Notes Client browser, but use a regular modern browser (Firefox, Chrome) to browse Notes applications.
Everything is ok when the user has an internet connexion, he can access the application on the online server through his favorite browser.
However some of my applications need to be used Offline, in local. When a user works in local, he opens the IBM Notes Client, go to his workspace and click to open an application locally. Then, the Notes Client runs a http server on a random port and open the application with the embedded Notes Client browser.
What I want to achieve is to be able to open the application on a regular browser (Firefox, Chrome), by just using the default system browser and not the embedded Notes Client browser.
Here is what I tried without success :
With window.location.href I get the port where the local http server runs and the path to the page that is opened in the embedded Notes Client browser. I get this kind of result :
127.0.0.1:54428/xsp/Gfn/CoffeShop.nsf/xp_home.xsp?OpenXPage&&xspRunningContext=Notes
So I just keep the interesting part :
127.0.0.1:54428/xsp/Gfn/CoffeShop.nsf/xp_home.xsp
Now I need to pass the session id has a parameter of this http request so the browser will have the right to access the application. I get the session ID with the following :
facesContext.getExternalContext().getRequest().getSession().getId()
From this I get an ID and I build my complete http request :
127.0.0.1:54428/xsp/Gfn/CoffeShop.nsf/xp_home.xsp?SessionID=ID-fae7aca8f062023972fe35e5909b0106f44ba2ae
But when I try this into a regular browser, instead of getting the page I get an error 500. If I look at the log of the server, I see the following error message :
Exception Thrown
javax.servlet.ServletException: The request is not coming from a trusted Rich Client part
But I am sure my ID is correct. I tried to investigate this on the internet but no success for now, I would be happy if someone has an idea about what do I miss? Or maybe another way to open a local application in the default system browser?
Thank you!
In short, you can't. This is disabled by security restrictions.
But maybe you should think again about a XPiNC application: With 9.0.1, the underlying XULRunner component was upgraded and supports now HTML5 and a lot of the "newer" features.
It matches Firefox 10.0.6, here are the HTML5 test results:
https://html5test.com/s/555ae51ca555ac7b.html
The only reasonable action you have at you disposal is to install Domino designer on the clients. Then you get the nhttp task that serves to a standard browser (you might get away analysing what nhttp needs and only install that part).
The caveat there: the local nhttp does not support authentication. So you need to hack around it (e.g. copy data back and forth between the local NSF and the properly secured one).
Alternative you could try the approach I took with vert.x (should work with any Java container, but then you won't have any XPages, just raw Domino data.
Danielle pushed that forward with the Crossworlds Project - which might be what you need.
Stephan says it as it is: the way you are considering is just going to cause you huge headaches.
If offline capacity is a must, have you thought about creating a pure Notes-Client application? That would certainly be far easier.

Can I change the logo of an IBM community through the REST API

I found this piece of documentation that suggests that we should be able to PUT a new logo in a community.
But the documentation also states that it is ignored on input.
Before we start intensive troubleshooting, it would help if someone could confirm that we can indeed change the logo programmatically.
Use the web address in the href attribute to obtain an image that represents the community's logo. The following operations are supported:
GET
Use the web address in the href attribute to obtain the community logo image file. If a logo has not been set, a default image is returned.
PUT
Use the web address in the href attribute to upload a new community logo image and replace the current one.
Attention: Specify the content type of the image file being sent with the request. For example: "Content-Type: image/jpeg"
This is the source:
http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Connections+4.5+API+Documentation#action=openDocument&res_title=Community_entry_content_ic45&content=pdcontent
Using the IBM SBT SDK 1.0.1 I was able to call CommunityService.updateCommunityLogo(new File("/path/to/my.jpeg"), communityUuid) without any error, but the JPEG I referred to was not set as the community logo however.
Maybe the size was not correct?
Sorry for this "non-answer", but it may help other people anyway: To fix the SBT SDK code at least :-/
UPDATE 2014-JUN-25:
I took a deeper dive into the http.wire logs, and surprisingly the call seems to trigger a logout (or session invalidation) without further notice. The REST request receives 200 OK but also some JavaScript looking like "hey guy, confirm who you are", and the browser prompts with a full-window Connections login prompt, although the LTPA token should not have timed out yet.
This is annoying, too, for another reason: If Connections is used inside a framed UI, the "main" application is wiped away after that, forcing Connections to full-window mode.
With IBM SBT SDK 1.0.3 (as of July 17, 2014) and IC5 it is working now. I had no opportunity to test this feature with 1.0.3 and IC45 however, but with 1.0.2 and IC5 it did NOT work; so it seems that something in 1.0.3 has been fixed here.
#mpjjonker you can look at CommunityService.java
the method updateCommunityLogo talks about using /communities/service/html/image URL to put the image.
String url = "/communities/service/html/image";
getClientService().put(url, parameters, headers, file, ClientService.FORMAT_NULL);

How to access NodeJS data through cakePHP?

Dummy question here but I haven't found any answer on the web for now.
I'm working on a cakephp website, installed on a Raspberry Pi, which is supposed to be able to connect wireless-ly through a local network to an Arduino YUN, get its components list.
For example :
"A LED is connected on ports :
Input : 2,
Output : 6;
and is currently on"
And change the input value :
"turn the LED off"
I'm not supposed to reload the webpage to see the change occurring.
So I figured out I needed NodeJS to send/receive the informations with websockets but I don't know how to connect NodeJS -running on its own webserver- to cakephp.
I'm a complete rookie with NodeJS, just did a few tutorials earlier, so I'm stuck here.
Does anyone know how to deal with this ?
Thanks in advance,
There are a few different libraries you can use to connect to the node server.
http://elephant.io/
https://github.com/bergie/dnode-php
You can, of course, just fall back to sending http requests (curl) from your cakephp app to the node server.
I have a few discoveries to add that may help some people.
While searching more deeply on DNode and elephant.io I found a cakePHP plugin called cake_websocket which make use of socket.io.
Seems to me that it is an equivalent to elephant.io specialized in cakePHP (while elephant.io is 'just' PHP).
I hope it can help someone !
Instead of using any library.
You can try iframe tag with src to your 'node.js' view.html.
So, listen for events on view.html which are triggered from your 'cakephp' view.html
So, you will have cakephp->view.html talking to node.js->view.html which is connected to node.js->index.js(server)

Script to Open URL as HTTP POST request (not just GET) in web browser

How can I open a URL from the command line script as a POST request to a URL? I'd like to to do this on Linux, Windows, and MacOS so a cross platform way of doing this
For each of these I can open a GET request to a URL using:
xdg-open [url] - Linux
start [url] - Windows
open [url] - MacOS
... but I don't see a way of doing a POST request. Is it possible, and if so how?
Also, showing how to add a POST body to the request would be appreciated too. Fyi, the script I'm writing is written in Ruby so anything built-in to the OS or something using Ruby is fine too.
UPDATED:
To clarify I'd like this open up in the default browser, not just issue the POST request and get the result.
Sorry, but there's no reliable way to do this across browsers and across operating systems. This was a topic the IE team spent a bunch of time looking into when we built Accelerators in IE8.
The closest you can come is writing a HTML page to disk that has an auto-submitting form (or XmlHttpRequest), then invoking the browser to load that page which will submit the form. This constrains your code to only submitting forms that are legal to submit from the browser (e.g. only thee possible content types, etc).
If you're using ruby you can use the NET::HTTP library: http://ruby-doc.org/stdlib-2.0/libdoc/net/http/rdoc/Net/HTTP.html
require 'net/http'
uri = URI('http://www.example.com/search.cgi')
res = Net::HTTP.post_form(uri, 'q' => 'ruby', 'max' => '50')
puts res.body
I don't know how compatible my solution is across browsers and platforms.
But instead of using a temporary file as described by #EricLaw,
you can encode that html with the auto-submit form in a Data URL, as i did here:
https://superuser.com/questions/1281950/open-chrome-with-method-post-body-data-on-specific-url/1631277#1631277

Resources