Reputation: 589
I want to assign value to the element and auto submit after page completely load.I encounter some question.
1.How to get the element in the tab?
2.How to fire submit event when assigned value?
I want to fire as the follow code:
chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
var url = tab.url;
var config = null;
if (tab.status !== "complete") {
return;
}
else {
// assign value and fire submit event
}
});
Help!!
Upvotes: 0
Views: 139
Reputation: 4537
I wouldn't do it this way. Why not use jQuery in a content script and trigger your action on ($document).ready()
? That way you'll have the document and can use jQuery selectors to get the elements that interest you. To submit, just get button using a selector and call click()
.
Upvotes: 1