Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Creates ContextMenus which will open the underlying urls when clicked
- function createCategory(title,url) //creates Context-menu
- {
- console.log("createCategory");
- chrome.contextMenus.create(
- {
- "title": title,
- "id": title,
- "contexts": ["page","selection","link","editable","image","video","audio"],
- "onclick": function()
- {
- console.log(title);
- popup(url);
- }
- });
- return title;
- }
- function popup(urlstring) //opens a site in new tab
- {
- console.log("popup");
- chrome.tabs.create ({url: urlstring})
- }
- function supaDupaRestart() //Don´t judge me,
- //the name of this function was chosen by a friend of mine.
- {
- console.log("supaDupaRestart");
- chrome.contextMenus.removeAll();
- for (var i = 0; i < catStrings.length;i++)
- {
- createCategory(catStrings[i], urls[i]);
- }
- //initMenus();
- //initlocalStorage();
- }
- var catStrings = [];
- catStrings = ["E-Mail", "Stundenpläne", "Selbstverwaltung", "Fachschaftsrat", "Aktuelles", "ILIAS", "MSDNAA", "Studierbar"];
- var urls = [];
- urls = ["https://studwebmailer.fh-dortmund.de/gw/webacc","http://www.fh-dortmund.de/de/fb/4/lehre/stundenplaene.php","https://userapp.fh-dortmund.de:8443/IDMProv/jsps/login/Login.jsp",
- "http://www.fsrfb4.de/", "http://www.fh-dortmund.de/de/studi/fb/4/aktuelles.php", "https://www.ilias.fh-dortmund.de/ilias/login.php?target=&soap_pw=&ext_uid=&cookies=nocookies&client_id=ilias-fhdo&lang=de",
- "https://dokumente.fh-dortmund.de/msdnaa/login/index.php", "http://www.studierbar.de/"];
- supaDupaRestart();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement