Giter VIP home page Giter VIP logo

Comments (13)

Lextum avatar Lextum commented on June 9, 2024 2

@eddex We definitely need to give this project to STAIR or have some maintainers that have access to MyCampus.

from hslu-simple-mep-results.

simonbaumeler avatar simonbaumeler commented on June 9, 2024 2

Hello @Lextum

Thank you for your Feedback, I've reached out to STAIR in order to organise something to keep this nice extension alive and up-to-date. Also if you tell me what to check for i can help you find a solution or we could even have a session on Discord in which i could show you everything you need on mycampus.

from hslu-simple-mep-results.

Lextum avatar Lextum commented on June 9, 2024 1

@simonbaumeler Yes there is. We reason was the permission "webRequest" we apparently don't use. I migrated to v3 and removed the permission. But I can't test if it still works. Could you check out the branch manifest_v3 and try it out? Please tell me, if you need help installing the extension directly from source.

from hslu-simple-mep-results.

simonbaumeler avatar simonbaumeler commented on June 9, 2024

Isn't there a chrome webstore account that should have been notified what happened with the extension and how to get it back online?

from hslu-simple-mep-results.

simonbaumeler avatar simonbaumeler commented on June 9, 2024

doesnt work yet:

{
"manifest_version": 3,
"name": "HSLU simple MEP results",
"version": "2.1.1",
"description": "Show the results of your exams in a nice way instead of the crappy default layout.",
"icons": {
"48": "icons/icon-48.png",
"96": "icons/icon-96.png",
"128": "icons/icon-128.png"
},
"action": {
"default_icon": "icons/icon-48.png",
"default_title": "HSLU simple MEP results",
"default_popup": "popup/popup.html",
"browser_style": true
},
"content_scripts": [
{
"matches": [
"://.mycampus.hslu.ch//stud-i/mein-studium/meine-anmeldungen/"
],
"js": [
"components/helpers.js",
"components/i18n.js",
"components/module_parser.js",
"lib/Chart.bundle.min.js",
"main.js"
],
"css": [
"templates/custom_styles.css"
]
}
],
"permissions": [
"storage"
],
"host_permissions": [
"https://mycampus.hslu.ch/"
],
"web_accessible_resources": [
{
"resources": [
"templates/grades_table.html",
"templates/credits_by_module_type_table.html",
"templates/custom_styles.css",
"data/modules_i.json",
"data/modules_ics.json",
"data/modules_wi.json",
"data/modules_ai.json",
"_locales/
"
],
"matches": [],
"extension_ids": []
}
],
"default_locale": "de",
"browser_specific_settings": {
"gecko": {
"id": "{64b1a494-88df-447e-b2aa-45d86fcc3c16}",
"update_url": "https://raw.githubusercontent.com/eddex/hslu-simple-mep-results/master/updates.json"
}
}
}

WhatsApp Image 2022-10-20 at 19 23 31

from hslu-simple-mep-results.

Lextum avatar Lextum commented on June 9, 2024

I believe you can ignore this error. The extension should still load inside MyCampus.

from hslu-simple-mep-results.

simonbaumeler avatar simonbaumeler commented on June 9, 2024

The extension does not load when opening the "Meine Anmeldungen" site.

from hslu-simple-mep-results.

Lextum avatar Lextum commented on June 9, 2024

Can you remove this part from the manifest and try again?

from hslu-simple-mep-results.

simonbaumeler avatar simonbaumeler commented on June 9, 2024

I'll try tomorrow 👍🏼

from hslu-simple-mep-results.

simonbaumeler avatar simonbaumeler commented on June 9, 2024

i removed the part from the manifest and got no error to start with afterwards but when loading the "meine Anmeldungen" page the extension still did not load.

Extension error:
image

in text:
/**

  • Returns the default locale from the manifest
  • @returns {string}
    */
    function getDefaultLocale() {
    if (Helpers.isFirefox()) {
    return (browser.runtime.getManifest()).default_locale
    }
    else {
    return (chrome.runtime.getManifest()).default_locale
    }
    }

/**

  • Returns the language of MyCampus
  • @returns {string}
    */
    async function getLanguage() {
    languageLinks = document.getElementsByClassName("languagelink");
    if (languageLinks.length > 0) {
    for (let i = 0; i < languageLinks.length; i++) {
    const languageLink = languageLinks[i];
    if (languageLink.classList.contains("active")) {
    return languageLink.hreflang;
    }
    }
    }
    // needed for the popup
    else {
    const i18nLanguage = (await Helpers.getItemFromLocalStorage("i18nLanguage")).i18nLanguage
    if (i18nLanguage === undefined) {
    return getDefaultLocale();
    }
    return i18nLanguage
    }
    }

/**
*

  • @param {*} language
  • @returns a object with all i18n strings for the given language
    */
    async function getMessages(language) {
    let messsages = await fetch(Helpers.getExtensionInternalFileUrl('_locales/' + language + '/messages.json'))
    .then(response => response.json())
    if (messsages === undefined) {
    messsages = await fetch(Helpers.getExtensionInternalFileUrl('_locales/' + getDefaultLocale() + '/messages.json'))
    .then(response => response.json())
    }
    return messsages;
    }

/**

  • Component for localization functions.
    */
    const i18n = {

    messages: "",
    /**

    • Gets the right language and the corresponding message file
      */
      init: async () => {

      const language = await getLanguage();
      i18n.messages = await getMessages(language);
      await Helpers.saveObjectInLocalStorage({ i18nLanguage: language })
      },

    /**

    • Returns the localized message
    • @param {string} message wo should be localized
      */
      getMessage: (message) => {
      if (message in i18n.messages) {
      return i18n.messages[message].message
      }
      return undefined
      },

}

Console errors:
image

from hslu-simple-mep-results.

simonbaumeler avatar simonbaumeler commented on June 9, 2024

hello @Lextum

I hope you are well. How is the status here?

from hslu-simple-mep-results.

Lextum avatar Lextum commented on June 9, 2024

Hello @simonbaumeler

Sorry, I completely forget about this issue. I contacted the Google Support and tried to resubmit the extension but they insisted on removing the WebRequest permission. Neither @eddex nor myself have access to MyCampus, so we can't test or try to find a solution for this problem. I you want to help us find a solution or can prove somehow that this permission is needed, I am happy to reupload the extension.

from hslu-simple-mep-results.

Lextum avatar Lextum commented on June 9, 2024

Hi @simonbaumeler

Sure, we can try to find a solution together. Just send me a PM on discord at Letum#5528. If you want to start some research, I would say the error you got in an answer above is a good starting point.

from hslu-simple-mep-results.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.