I am creating a Chrome extension, with the following code.
File manifest.json
{
"name": "Project",
"version": "1.0.0",
"manifest_version": 2,
"description": "Popup when website requires Log in",
"browser_action":{
"default_icon":"icon_19.png",
"default_popup":"Popup.html"
}
}
File Popup.html
<html>
<head></head>
<body>
<div class="plus" id="plu"></div>
<script src="inline.js"></script>
</body>
</html>
inline.js:
window.onload = function() {
document.getElementById('plu').onclick=popup;
}
function popup() {
var link = document.URL;
alert("This is the link: ( " +link+ " )");
}
When I click the div with the ID 'plu', it gets the URL of file popup.html, but not for the website.