rahulkapoor90/VITacademics-Enhancement-Suite

View on GitHub
Extension for Edge/scripts/background/background.js

Summary

Maintainability
A
3 hrs
Test Coverage
function install_notice() {
    if (localStorage.getItem('install_time'))
        return;

    var now = new Date().getTime();
    localStorage.setItem('install_time', now);
    chrome.tabs.create({url: "http://rahulkapoor90.github.io/vitacademics-enhancement-suite/thanks"});
var opt = {
  type: "basic",
  title: "Hello Friend!",
  message: "Thank You for installing VITacademics Enhancement Suite.",
  iconUrl: chrome.extension.getURL('images/github-logo.png')
}
    chrome.notifications.create(opt);
}
var notify1 = function(data){
    var options = {
        "title" :   "Marks Change Notification",
        "type"  :   "basic",
        "iconUrl"   :   chrome.extension.getURL('images/github-logo.png'),
        "message"   :   "Following marks have been changed."
    };
    chrome.notifications.create(options);
}
install_notice();
chrome.webRequest.onBeforeRequest.addListener(
    function(details) {
        switch (details.url) {
            case "https://vtop.vit.ac.in/student/images/round_orange.gif":
                return {redirectUrl: "https://res.cloudinary.com/dadfowug4/image/upload/v1479314802/nAnJHcz_kt2did.png" };
            case "https://vtop.vit.ac.in/student/images/round_blue.gif":
                return {redirectUrl: "https://res.cloudinary.com/dadfowug4/image/upload/v1479314802/YFcV4bO_oppp1h.png" };
        }
    },
    {urls: ["*://*.vit.ac.in/*.gif"]},
    ["blocking"]);