Simulate iPhone environment in Firebug - iphone

Is there a way I can get Firebug or Firefox to send an iPhone user agent string to the browser, so I can debug the iPhone layout of my site more easily?
Thanks,
Kevin

Search for a User-Agent switcher extension and install that. One option is User Agent Switcher.
More generally, you can look for an extension to let you manipulate generic HTTP headers, which would of course include the User-Agent. It looks like Modify Headers is up to this task.

Try User Agent Switcher! Then set your user agent to whatever you like, in the tools menu.

Related

FMP URL Format in Filemaker WebDirect

I am trying to use some webviewers on Filemaker WebDirect. I would like to call a script in filemaker from a button on the webviewer. It works great in pro but I'm not sure of the url protocal I need to use in web direct. What is the format I should use when trying to call a filemaker script from a webviewer in webdirect?
You'll need to test this out because I haven't tested it, but I believe that when you use a webviewer in a WebDirect solution the webviewer actually displays an iframe tag and the contents of the webviewer works like any other iframe on a webpage, i.e. it's no longer part of the WebDirect application.
You can check it out in the browser interface of your WebDirect solution by right-clicking on the webviewer and selecting "inspect element". That should open up the browser's developer tools and show you the webviewer's element in the overall HTML structure. The webviewer should be an iframe.
All of that said, if it does treat the content of the webviewer as an iframe and therefore the content of the iframe is outside of your WebDirect solution, it means that whatever communication you have from the webviewer content would need to communicate externally with your FileMaker Solution via XML custom web publishing. It would be like standing inside of your house, reaching out of a window, unlocking your front door, and grabbing something you want.
This means you would need:
Web Publishing turned on on your FileMaker Server
A user with the xml extended privileges enabled
An external IP address that you can access your FileMaker Server by
Then you could (again, theoretically I have not tried doing this) use a link that contains a url with the XML custom web publishing syntax to perform the script. You can find a description of the syntax in the FileMaker Server documentation PDF fms13_cwp_xml.pdf. I can't find a good link to the syntax online at the moment, but you could search around for it. The basic syntax outlined in the PDF is:
<scheme>://<host>[:<port>]/fmi/xml/<xml_grammar>.xml[?<query string>]
and calling a script would look like:
http://myfmsdomainname.com/fmi/xml/fmresultset.xml?-script=theScriptIwantToFire
My url structure could be off.
Anyway, it sounds like it could be a pain in the ass, but it may be a solution! Good luck!
This is tricky because you will have to communicate with the Webdirect client via FMServer!
Use the FMServer PHP interface for your webpage within the webviewer to communicate to the server. Your web page can either:
1) Directly set a value in the server that your client will monitor
2) If it has to call a script then call a script on the server, your client will still have to monitor a value. e.g. use the php API on your webpage. Setup your database connection (see the API docs in your FMServer folder for an example), then call:
$newperformscript =& $fm->newPerformScriptCommand($layoutName, 'scriptname',$scriptParameters);
$result = $newPerformScript->execute();
Your Webdirect Client will then need to monitor for that change. While Webdirect is on the layout with the webviewer, your client could use the filemaker script step to actively monitor for a change in value via a timer:
Install OnTimer [Interval:secs]
When your client detects that change that you made then perform your action.
Note: You will have to pass an ID of the client to the webviewer, and your webviewer will have to pass that ID back to the server, and your client will have to monitor for that ID so that all clients don't respond to the change. You can pass whichever client ID you choose to use to the webviewer via the URL using GET.
If your server is local then the change will be detected in one second if that is what your Install OnTimer timer is set to.
What you are doing is far from ideal with Filemaker... I suggest that you look into a different UI paradigm if possible.

Chrome NPAPI method for making it downloading url

I've recently got into using FireBreath for some simple task: download a clicked url. Is there a built-in method or something else with which i can add the url to Chrome's native download queue? or at least load up a Save Link As.. dialog (that would be ok too)?
You can show a save dialog by using the native OS calls to do so; for example, on the Mac you'd use NSSavePanel. That won't hand the download off to the browser though, it would just give you a user-selected filename to download to. You'd still have to do the download yourself.
NPAPI doesn't have a way to tell the browser to start a download using its UI. That would be something that would be an extension API if it existed (and what you'd want to file a request for if it didn't), not part of NPAPI.
Send the following HTTP header along with the content.
Content-Disposition: attachment
Optionally with ; filename="filename here".
If you want to download a clicked URL with FireBreath then you're not going to get a download dialog; if you need a download dialog, why are you using FireBreath?
The easiest way to get a download dialog is to set window.location to the URL you want to download and wait for the browser to pop the dialog up itself; you can do this with FireBreath or with javascript, it works the same way.

Define custom User-agent header in the HTTP request?

I would like to get a glimpse of web-sites created for iPhone devices. In order to be able to view those sites I have to modify the User-agent header in the HTTP request that my browser sends. That way I can trick the web-server into believing that my browser is an iPhone browser, and then the web-server would send my the iPhone version of the web-site.
So, how can I modify the User-agent header that my browser sends in each HTTP request.
Maybe there is an Firefox plug-in that allows modifying request headers?
Also, I think I heard that Safari allows that somehow....
You can try the user-agent switcher plugin.
Yeah you can do this with Modify Headers add-on for Firefox.
First, there's the following plugin: https://addons.mozilla.org/en-US/firefox/addon/59/
Also, there's Firefox configuration: type "about:config" as URL in Firefox, find general.useragent.* properties there.
You don't need a browser add-on in order to add a custom User-Agent string in your HTTP header. Chrome has added this feature to developer tools.
Open the developer tools and click on the Toggle Device Toolbar option or press cmd+shift+M to open it. You can select a device user agent from the presets or you can also define a custom device like mentioned in the below screenshot.

Include a picture in mailto:

I'm interested in placing a picture (along with some text) in a prepared email for the user to send off. Is there any way to use mailto: to do that?
No. The mailto: scheme does not support attachment. (See http://www.faqs.org/rfcs/rfc2368.html).
If you write an app you can attach an image with MFMailComposeViewController.
No, mailto: is just a HREF target for the A tag, and just instructs the operating system to open the mail browser to a specific location (with subject). To send a custom email on click of a link, you'll need server side code, such as PHP (sendmail) or Ruby (ActionMailer)
I think the best you can do is link to an image, like this:
test

How do I embed openads (Openx) ads in an iPhone application

I have tried using iframe, javascript and image tag Ad tags in iPhone application, but none of them work. When a user clicks on an image, the browser is launched but then nothing happens (you get a blank page). Anyone know how to proceed?
To proceed: debug it. A standard OpenX click URL will do a redirect. What URL is the browser sticking at?
I don't know anything about iPhone applications, but I do know about interfacing to OpenX. You possible should consider using the OpenX API, which will allow you to pull all the information you need into the 'back end' of your application, then use it as you need.
Proplem in iphone must be active enable java in iphone safari settings