我试过环顾Stackoverflow,但找不到任何特别的东西。从Chrome扩展程序的Javascript中获取标签网址
所以基本上,我有我的网站共享页面,是这样的:
http://domain.com/share.php?link=http://sharing.url
我的分机是这样的:
{
...
"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+"");
但这是错误的网址。如何在没有做任何太花哨的事情的情况下获得标签网址?
做:'-URL ...? – 2012-08-03 20:12:09