forked from Sneezry/chrome_extensions_and_apps_programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
function httpRequest(url, callback){ | ||
var xhr = new XMLHttpRequest(); | ||
xhr.open("GET", url, true); | ||
xhr.onreadystatechange = function() { | ||
if (xhr.readyState == 4) { | ||
callback(xhr.responseText); | ||
} | ||
} | ||
xhr.send(); | ||
} | ||
|
||
httpRequest('http://sneezryworks.sinaapp.com/ip.php', function(ip){ | ||
document.getElementById('ip_div').innerText = ip; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "查看我的IP", | ||
"version": "1.0", | ||
"description": "查看我的电脑当前的公网IP", | ||
"icons": { | ||
"16": "images/icon16.png", | ||
"48": "images/icon48.png", | ||
"128": "images/icon128.png" | ||
}, | ||
"browser_action": { | ||
"default_icon": { | ||
"19": "images/icon19.png", | ||
"38": "images/icon38.png" | ||
}, | ||
"default_title": "查看我的IP", | ||
"default_popup": "popup.html" | ||
}, | ||
"permissions": [ | ||
"http://sneezryworks.sinaapp.com/ip.php" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<html> | ||
<head> | ||
<style> | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
width: 400px; | ||
height: 100px; | ||
} | ||
|
||
div { | ||
line-height: 100px; | ||
font-size: 42px; | ||
text-align: center; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="ip_div">正在查询……</div> | ||
<script src="js/my_ip.js"></script> | ||
</body> | ||
</html> |