Note that there are some explanatory texts on larger screens.

plurals
  1. POSimple JavaScript Chrome Extension - Opening a URL - modified from Input Text
    primarykey
    data
    text
    <p>I'm trying to use the code below to make a simple chrome extension, to have input text, and a button, and upon a button click, I want to pull up a specific URL. I'm having trouble writing the code. I'm fairly new to JavaScript.</p> <pre><code>&lt;!doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Title Name&lt;/title&gt; &lt;style&gt; body { min-width: 357px; overflow-x: hidden; } img { margin: 5px; border: 2px solid black; vertical-align: middle; width: 75px; height: 75px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="text" name="enter" class="enter" value="67" id="lolz" /&gt; &lt;button type="button" id="the_button"&gt;LookUp Site ID&lt;/button&gt; &lt;script src="popup.js"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <h2> popup.js - Updated</h2> <pre><code>var VanillaRunOnDomReady = function() { document.getElementById('the_button').addEventListener('click', myFunction); function myFunction() { var siteid = document.getElementById('lolz').value //window.location = "https://www.websiteimusing.com/siteid" + siteid; chrome.tabs.create({ url: "https://www.websiteimusing.com/siteid" + siteid}); } } </code></pre> <p>}</p> <h2> Manifest.json</h2> <pre><code>{ "manifest_version": 2, "name": "ID URL opener", "description": "Enter ID and it will pull up the correct URL", "version": "1.0", "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html" }, "permissions": ["tabs"] } </code></pre> <h2>Current Error - Updated</h2> <p>It is not populating a error, just never actually loading the URL upon button click, any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload