I am building one chrome extension for capturing funds from BigCommerce admin. But BigCommerce admin seems to be built by angular (I do not know how angular work), and I can NOT get the capture button element from source code, which is dynamically added by angular iframe, like ajax.
<iframe id="content-iframe" class="cp-iframe" frameborder="0"
ng-idle-watch-iframe="" iframe-manager="" post-message=""
ng-class="{ 'ui-hidden': !(MainCtrl.isIframeActive('cp')) }"
name="cp-iframe" ui-interaction="">
</iframe>
I can get the order detail page like: your-bigcommerce-domain.com/admin/order/{order_id}/details
the result like:
We can find the "capture funds" button, but it is NOT clickable.
I only can see clickable capture button via browser inspect.
whether can the jquery get elements from "inspect" instead of source code ?
the action link of capturing fund is
your-domain.com/admin/order/{order-id}/capture-funds?authenticity_token=b3d4*************51b46abbdc1d9
but I do not know where the authenticity_token is from.
Actually, I have already tried below way to wait chrome browser to finish loading all elements:
setTimeout(function()
{
console.log($('button.capture-trigger').length);
$('button.capture-trigger').click();
}, 6000);
but it is still not working. do you have any other ideas please ?