Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "name": "My First Extension",
- "version": "1.0",
- "manifest_version": 2,
- "description": "The first extension that I made.",
- "browser_action": {
- "default_icon": "icon2.png"
- },
- "permissions": [
- "tabs", "https://login.live.com/"
- ],
- "content_scripts": [
- {
- "matches": ["https://login.live.com/"],
- "js": ["content.js"],
- "run_at": "document_end"
- }
- ],
- "web_accessible_resources": ["inject.js"]
- }
- (function (chrome) {
- var js = document.createElement('script');
- js.type = 'text/javascript';
- js.src = chrome.extension.getURL('inject.js');
- document.getElementsByTagName('head')[0].appendChild(js);
- }(chrome));
- (function () {
- console.log('test');
- alert("hello it work");
- // define your username and password
- var myUsername = '';
- var myPassword = '';
- // find the fiends in your login form
- var loginField = document.getelementsbyname('loginfmt');
- var passwordField = document.getelementsbyname('passwd');
- // fill in your username and password
- loginField.value = myUsername;
- passwordField.value = myPassword;
- // if you want, you can even automaticaly submit the login form
- var loginForm = document.getelementsbyname('SI');
- loginForm.submit();
- }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement