Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal Button For Google Chrome Extension

I'm attempting to add a donate button (because I like money) to my google chrome extension. I'm having trouble with it because the Chrome extension tries to open the paypal created donation button in the popup.html window. When I click the button, my extension just restarts and there is no donation window.

I have tried using chrome.tab.create() to try to make it open to a tab but it doesn't seem to have any effect.

The code to the donation button is as follows:

<form action="chrome.tabs.create ({'url': 'https://www.paypal.com/cgi-bin/webscr'});" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="XXXXXXXX">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">

Any help with this would be great!

Thanks

like image 635
infinityLoop Avatar asked Sep 15 '11 22:09

infinityLoop


2 Answers

Try a link instead of a form: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=xxxxxxx

like image 175
Robert Avatar answered Oct 24 '22 23:10

Robert


Instead of:

<form action="chrome.tabs.create ({'url': 'https://www.paypal.com/cgi-bin/webscr'});" method="post">

Try:

<form action="https://www.paypal.com/cgi-bin/webscr" target="_blank" method="post">
like image 36
serg Avatar answered Oct 24 '22 23:10

serg