I'm working on my first Chrome extension and I still can't solve this problem. The idea behind my extension is simple. You type in an ID into the form and hit search. This triggers a new window popping up with a long URL. In the middle of this URL, you should see the ID that we typed into via the form. What happens instead is a new window is popping up, loading a long URL and instead of the number you can see "[object%20Event]". In other words, I want the ID submitted and merge it with two other strings - that all together constitute the URL.
Any ideas? Any help is much appreciated! Many thanks in advance!
HTML
<head>
<script type="text/javascript" src="ChromeFacebook.js"></script>
</head>
<body>
<h1 id="title"> Enter ID: </h1>
<h2 id="paragraphs"> Comments </h2>
<form id="form1">
<input type="text" size="60" placeholder="Photos-commented"><input
type="submit" value="Search">
</form>
</body>
</html>
JS
var id = document.getElementById('form1');
function a(id) {
window.open("https://www.facebook.com/search/str/" + id + "/photos-
commented", "a")
{;
document.getElementById('form1').addEventListener('submit', a);
`
– Kos Jan 20 '18 at 15:32, however, whenever I click on the extension it automatically opens the URL without giving me a chance to type in a number. Also, thanks for the link - I willcheck it
– Lo1988 Jan 20 '18 at 15:37