BahCmoa
unread,Nov 27, 2010, 7:04:56 PM11/27/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium-extensions
Hi guys,
4 hours that i'm trying to do a "simple" thing without any result :
( ... all i would like is to be able to get the source code of a tab
(with "innerHTML") to write it in a hidden input of a form in a
background.html.
here is my code of background.html:
--------------------------------------------------------------------------------------------------------------------------
<script>
chrome.browserAction.onClicked.addListener(function(tab) {
var Inner = "JSvide";
chrome.tabs.executeScript(null, {code:" Inner =
document.body.innerHTML;"});
alert ("Inner : " + Inner) ;
document.getElementById("leCode").value =
Inner ;
document.getElementById("leForm").submit() ;
});
</script>
.
.
.
<form id="leForm" name="leForm" action="anotherPHPscript.php"
method="POST" target="_blank">
<input type="hidden" id="leCode" name="leCode" value="">
</form>
--------------------------------------------------------------------------------------------------------------------------
my problem is that i can get the "innerHTML" with
"chrome.tabs.executeScript" but after that, impossible to put it in
"Inner" ... then, impossible to write it in the form. When i launch
it, the "alert" shows me "JSvide" and not the HTML code of the
executeScript command.
If someone could have the beginning of a solution he/she would be God
for me !! :-)
thank you