I tried looking around Stackoverflow but couldn't find anything specifically for this.
So basically, I have a share page for my website that goes like this:
http://domain.com/share.php?link=http://sharing.url
My extension goes like this:
{
...
"browser_action": {
"default_icon": "icon.ico",
"default_popup": "schare.html"
}
...
}
schare.html:
<style>
body, html{
margin:0;
padding:0;
}
iframe{
width:520px;
height:200px;
margin:0;
}
</style>
<iframe id="iframes" frameborder="0"></iframe>
<script type="text/javascript" src="popup.js"></script>
and popup.js:
document.getElementById("iframes").setAttribute("src", "http://domain.com/share.php?link="+location.href+"");
But that's the wrong URL. How can I get the tab url in there without doing anything too fancy?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…