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
Try a link instead of a form: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=xxxxxxx
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">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With