Why to learn developing chrome extensions ?
There are a lot of reasons but main point is people love to get update in seconds and want a quick & simple interface b/w them and server in that chrome help us alot. Mostly everyone use Google Chrome so if you can give your visitor direct interface to your site without any web address they surely love it and thats the reason you must start up with chrome extension.
What skills you need to develop a chrome extension.
- Json ( lil bit is enough)
- HTML
- JS
- CSS
The above is enough to start up.
In my last post i shown you how to code a file sharing site what if we can develop a chrome extension on it ? isnt it cool ? :D.
- Firstly, Go to chrome settings and select extensions tab from left side and check Developer mode.
- Now make a folder on desktop name it whatever you want.
- Now make a JSON file in call it "manifest.json" and put following code in it.
{ "manifest_version": 2, "name": "ShareABC", "description": "Share any file extension ABC", "version": "1.0", "browser_action": { "default_icon": "icon.png", "default_popup": "index.html" }, "permissions": [ "activeTab", "https://ajax.googleapis.com/" ] }
The above code give your extension a valid name and then its icon and its HTML load file the content you write in index.html ll get execute.
- So we are working on file sharing extension lets add upload form in index.html
<form method="post" action="http://urdomain/index.php" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="2000000"> <div class="upload"> <input name="userfile" type="file" id="userfile"> </div> <br> Password (optional) : <input type="password" name="pas" placeholder="Password"><br><br><input name="upload" type="submit" class="btn btn-success" id="upload" value=" Upload & Share"> </form>
- here i am making a post request to my file sharing script uploaded on my host it'll upload file through it on it respective server via this extension :D
So what we done is simple made a extension which ll show a upload form to user and with the help of POST request it ll upload the file and give u download link ;) here i m attaching screenshot of my extension.
No comments:
Post a Comment