ForeverDev

Untitled

Oct 11th, 2014
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //popup.html
  2.  
  3. <html>
  4.     <body>
  5.         <input type = "button" id = "the_button" value = "My button" onclick = "sayHi()"></input>
  6.     </body>
  7.     <script src = "popup.js" ></script>
  8. </html>
  9.  
  10. //popup.js
  11.  
  12. document.getElementById("the_button").addEventListener("click", function() {
  13.     var win = window.open("http://www.roblox.com", "roblox", 400, 400)
  14.     //this is where I'm having some problems
  15.     win.ready(function() {
  16.         console.log(win.location.href)
  17.     })
  18. })
  19.  
  20. //manifest.json
  21.  
  22. {
  23.   "manifest_version": 2,
  24.   "name": "Test",
  25.   "description": "Test Extension",
  26.   "version": "1.0",
  27.  
  28.   "icons": {
  29.     "48": "icon.png"
  30.    },
  31.  
  32.   "permissions": [
  33.     "http://*/*",
  34.     "https://*/*"
  35.   ],
  36.  
  37.   "content_scripts": [{
  38.     "matches": ["http://*/*", "http://*/*"],
  39.     "js": ["jquery.js", "popup.js"]
  40.   }],
  41.  
  42.   "browser_action": {
  43.     "default_title": "This is a test",
  44.     "default_icon": "icon.png",
  45.     "default_popup": "popup.html"
  46.   }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment