I can't seem to get this to work. I've looked for an answer but nothing seems to help me. I had a working version as an html page, but I cannot get it to work as an extension. This is my first extension so if I am doing something wrong please notify me so.
manifest.json:
{
"manifest_version": 2,
"name": "ROBLOX User-Profile Finder",
"description": "Find any user's profile by typing in their name.",
"version": "1.0",
"permissions": [
"<all_urls>"
],
"browser_action": {
"default_icon": "Icon.png",
"default_popup": "Popup.html"
}
}
Popup.html:
<!DOCTYPE html>
<html>
<head>
<script>
var link="http://roblox.com/user.aspx?username=";
function Submit(user) {
window.open(link.concat(user));
}
</script>
</head>
<body>
<p>Type in the roblox username:</p>
<input type="text" id="username" value="">
<button type="button" onclick="Submit(window.getElementById('username').value)">Go to Profile!</button>
</body>
</html>
What is the problem here? I think I'm missing something, as I usually program in Lua, not JavaScript.
Solved: The problem was that I was making scripts in the middle, and I kept asking for help, the problem was a simple mistake with the quotation marks and a few other little errors. Here's the finished scripts if anyone's interested:
manifest.json:
{
"manifest_version": 2,
"name": "ROBLOX User-Profile Finder",
"description": "Find any user's profile by typing in their name. Note: Not created by roblox.",
"version": "1.0",
"permissions": [
"<all_urls>"
],
"browser_action": {
"default_icon": "Icon.png",
"default_popup": "Popup.html"
}
}
Popup.html:
<!DOCTYPE html>
<html>
<head>
<p>Type in the roblox username:</p>
<input type="text" id="username" value="">
<button type="button" id="Button">Go to Profile!</button>
</head>
<body>
<script src="Script.js"></script>
</body>
</html>
Script.js:
var link="http://roblox.com/user.aspx?username=";
function Submit() {
window.open(link.concat(document.getElementById("username").value));
}
document.getElementById('Button').addEventListener("click", Submit);