Skip to content

Commit

Permalink
2013103103
Browse files Browse the repository at this point in the history
  • Loading branch information
Sneezry committed Nov 1, 2013
1 parent 3b6048c commit 9b93be4
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 0 deletions.
Binary file added what_is_my_ip/images/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added what_is_my_ip/images/icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added what_is_my_ip/images/icon19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added what_is_my_ip/images/icon38.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added what_is_my_ip/images/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions what_is_my_ip/js/my_ip.js
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;
});
22 changes: 22 additions & 0 deletions what_is_my_ip/manifest.json
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"
]
}
25 changes: 25 additions & 0 deletions what_is_my_ip/popup.html
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>

0 comments on commit 9b93be4

Please sign in to comment.