I am trying to make my own chrome extension but I have only basic knowledge of html and js is gibberish to me. So I am begging for help.
I have this kind of url:
http://www.website.com/blabla/number1/number2/blabla/number3_orig.extension
http://www.website.com/blabla/11912/57294/blabla/001_orig.png
And I am trying to make an extension which will allow to increase or decrease numbers in that url and show the webpage at the same time and also I want the ability to choose the extension at the end of url (png or jpg).
http://postimg.org/image/40cevbqlh/full/
"+" means current number plus one, and "-" means current number minus one, radio buttons changes the extension .png or .jpg
Example: I have this url:
http://www.website.com/blabla/00000/00000/blabla/000_orig.png
and when I click the first "+" this url should open:
http://www.website.com/blabla/00001/00000/blabla/000_orig.png
and now I click the second "+" this url should open:
http://www.website.com/blabla/00001/00001/blabla/000_orig.png
and now I click the ".jpg radio button" this url should open:
http://www.website.com/blabla/00001/00001/blabla/000_orig.jpg
and now when I click the second "-" this url should open:
http://www.website.com/blabla/00001/00000/blabla/000_orig.jpg
etc etc...
I was able to make this code:
manifest.json
{
"name": "Name",
"version": ".1",
"description": "Description",
"background": {
"page":"bg.html"
},
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html",
"default_title": "Click here!"
},
"manifest_version": 2,
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["content.js"]
}
],
"permissions": ["tabs"]
}
popup.html
<!doctype html>
<!--
This page is shown when the extension button is clicked, because the
"browser_action" field in manifest.json contains the "default_popup" key with
value "popup.html".
-->
<html>
<head>
<title>Getting Started Extension's Popup</title>
<style>
body {
font-family: "Segoe UI", "Lucida Grande", Tahoma, sans-serif;
font-size: 100%;
}
</style>
<!--
- JavaScript and HTML must be in separate files: see our Content Security
- Policy documentation[1] for details and explanation.
-
- [1]: https://developer.chrome.com/extensions/contentSecurityPolicy
-->
<script src="popup.js"></script>
</head>
<body>
<button id="plus1">+</button>
<button id="plus2">+</button>
<button id="plus3">+</button>
<br/>
<button id="minus1">-</button>
<button id="minus2">-</button>
<button id="minus3">-</button>
<br/>
<input type="radio" name="extension" value="png">.png
<input type="radio" name="extension" value="jpg">.jpg
</body>
</html>
bg.html
<html>
<script src="redirect.js"></script>
</html>
popup.js
??? I dont know what code should be here...
redirect.js
??? I dont know what code should be here...
content.js
??? I dont know what code should be here...