Paypal hybrid app - html

I have managed to integrate a donate paypal button in a Cordova app:
<form action='https://www.paypal.com/cgi-bin/webscr' method='post' target='_top'>
...
</form>
All works fine except that when the button is pressed, a new window appears and completly covers the app webview making it impossible for the user to go back to the app (the only way is killing the app process), which I think is a very bad user experience.
Things that I've tried:
target='_blank': same result
target='myIFrameName': Cross-domain problem
Post the form via ajax and put result in a div: Form must be calculated on the fly error (with $http.put in ionic, haven't tried with jQuery)
Please, any solution?
The best one would be to have the paypal window inside the current webview not covering header, as I could place a back button there (something like iframe solution that could work with cross domain) but also could be with placing a link to go back in the paypal donate page. I haven't investigated deeper enought the paypal plugin at this location: https://github.com/paypal/PayPal-Cordova-Plugin. anyone knows if it could do the work? (I've already opened an issue there asking for this feature)

Why not use a inApp browser ? Cordova InAppBrowser
And call cordova.InAppBrowser.open( url, '_blank', 'location=yes'); on a button click function, or whatever suits you.
_blank = inside the app
_system = system's browser( will redirect you from app )

Related

How do I make a website show up in a Google Chrome Extension Popup

Basically, I have this chatting website.
I want it to open up the web app inside of a popup, and I would also like for it to create a notification when I have unread messages.
I need to know if I can make it so it opens like it's in a website, or if I need to completely rewrite the coding.
You can in principle try to embed an iframe in the popup to show the webapp, but a popup page is completely destroyed when you close it, so it won't stay connected that way.
You would probably need another way.
It does not seem like Hall has any public API that you can use.
So probably your only option is to use a content script to interact with Hall opened in a tab. If you're adventurous, you could try to embed an iframe in your background page and interact with it there, but Hall may disallow framing.
All that said, I'm not so sure Hall will appreciate creating alternative software to interact with it.

php or other script to close browser session after html form submission

I recently implemented a .htpasswd based login page and am trying to figure out a certain way I have in mind to close the browser window (because that is how I can reset the authentication so the user cannot log in again).
My idea is that once the user logs in and submits the information on the form they have to fill out, the submission of the form would trigger a script to close the browser window in 5 seconds. The user would be warned before hand that this will happen.
I'm not a pro coder when it comes to scripting, any ideas? I haven't found much information on this specific topic.
With jquery/javascript you can use window.close()
An example using a button...
html
<button id="close">Close</button>
jquery
$(document).ready(function() {
$('#close').click(function(){
window.close();
});
});
For further info...

how do I create a "load" window with text inside in a web app?

My inquiry is rather simple for a beginner's web developer, but unfortunately my web programming knowledge is archaic.
I have a URL that runs some server-side code and spits out some html code. I want to have an HTML page, where I click on "refresh" and the server-side code URL is loaded, and then printed inside a window in the HTML page (or updates some etc.) without having to reload the tab/page in the browser. While it is loading the URL, I would like an animation of a "loading" icon to appear (just like in a flash app) in the middle of the frame where the text is supposed to appear.
Very trivial, but I am not sure how to do it.
Any ideas?
I am not sure which technology you are using but I am doing the same in JavaScript and AJAX. For demo, you can visit, http://www.charkula.com/singapore_vieweventdetails.asp?id=16, click on "Check Availability or Buy Tickets" button.
What it does is when the button is clicked, it calls and executes the code on the server and fetches the data from database, and same goes for other combo's after this.
Let me know if you want the code for both JavaScript & AJAX.

How to limit the user to certain urls in webview?

I have created an adobe air application. I have integrated facebook in my application.
Now when the facebook login page opens in the webview, user has the option to use "Forgot your password" and "Sign Up" links. I want to prevent the use of these links.
I am using LOCATION_CHANGED and LOCATION_CHANGING events to detect the browsing of the user. How can i prevent this?
Any help appreciated.
Have you tried using event.preventDefault()? I think that should stop the web view from redirecting. Perhaps you can evaluate the url the view is trying to go to and selectively call preventDefault() then?

Chrome Extension - Load popup whenever Facebook is visited?

I'm just starting on a Chrome extension. I want it to load a popup element whenever the browser loads a Facebook url.
Is this possible? And how? // ANSWERED.
Okay, then.
Now, I now how to make an extension that drops down in a small window at the top right of the page beneath the extension icons. *But how can I create a new div anywhere on the web page, like this buzzgrowl extension:http://buzzgrowl.com/ *?
Yep it's possible. You can trigger a popup in your javascript. Set it to work only on facebook.com.
You can also do javascript checking of the url via window.location.