Coder Social home page Coder Social logo

premid / extension Goto Github PK

View Code? Open in Web Editor NEW
76.0 6.0 29.0 3.96 MB

๐Ÿงฉ Source code of the official PreMiD extension.

Home Page: https://premid.app/

License: Mozilla Public License 2.0

JavaScript 32.52% HTML 0.77% CSS 2.52% TypeScript 43.57% Vue 16.69% SCSS 3.93%
chrome firefox opera chromium

extension's People

Contributors

27rogi avatar alexbcberio avatar bas950 avatar callumok2004 avatar eggsy avatar encrypteddev avatar fruxh avatar i1u5 avatar imgbotapp avatar mulverinex avatar rubensei avatar rxri avatar thedropx avatar timeraa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

extension's Issues

Tmp presence considered like added presence

When a tmp presence has been loaded locally, when on the presence page the buttons shows as not added, however when you click add, the page button shows as the presence is installed, but the presence from the store is not added. When you click remove presence the tmp presence is renoved

Steps

  1. Load a Presence locally into the extension (Donot have the presence installed tmp/actual)
  2. Goto the presence page on premid
  3. Click add presence (check extension list)
  4. Click remove presence (check extension list)

System: W11

Problems with temporary presences

OS: Windows 10 64-Bit (Latest version)
Browser: Firefox 73.0.1 (64-Bit)

grafik
I pressed shift to load a created presence and it said that it's already loading a presence - I could load mine tho, which was quiet strange.
But it became more strange after I restarted Firefox to remove the temporary presence. It was still there! I used the removal-tool from the extension to get rid of it and then every single presence was gone. The store doesn't work correctly anymore. Only a reinstallation of the extention fixed it again.

Just wanted to report it because it's really annoying to reinstall the extension over and over again just to get your presence when it got released on the store.

Hidden Setting by Default

Feature Description

Hide settings by default โ€“ before the code (presence.ts) loads โ€“ and show them later with the presence.showSetting(id) function.

Why?

Because I would like to create activity for the site staff.
e.g. I would like to show that I am in a specific area of the control panel but not show in the settings the name of this area.
I know it doesn't make sense to have all this anonymity because it is an open source project but I don't think it is a useless function

metadata.json

{
  "...",
  "settings": [
    {
      "id": "staff",
      "title": "Staff",
      "icon": "fas fa-hammer",
      "value": false,
      "hidden": true
    },
    {
      "if": { "staff": true },
      "id": "s_cpanel",
      "title": "โ””โ”€ Control Panel",
      "value": true
    }
  ]
}

Hide presence when no longer in the browser

Is your feature request related to a problem? Please describe.
Yes.
I don't like it when I go on a site, for example, Twitter, and leave, do something in another program, and it still says that I'm on Twitter.

Describe the solution you'd like
Hide the presence if the window is not active.
So when I click away, it no longer says that I'm on that site.
Exceptions are streams, like music and video, where it continues to play when I click away.

Describe alternatives you've considered
Hide the presence if the user isn't active for a few seconds.
Exceptions are music and video sites, and things we read, like newspapers.

Additional context
none

Trying to load this in Opera - Error: Manifest file is missing or unreadable

I downloaded this repository, unpacked the .zip archive, and then tried to load it in Opera by using "load unpacked" (developer mode in the extensions page active). Several errors were found:

  1. The manifest.json is located in /assets, while it should be in /. I manually moved it to /, so I could load the extension.
  2. The icon paths all pointed to assets/images, instead of src/assets/images.
  3. "Default locale was specified, but _locales subtree is missing". I simply commented out the default locale line.
  4. the file "js/vendor.js" was marked as missing. Strangely enough, the entire js folder was not there.

At this point my coding knowledge failed me, and I wasn't able fix any more.

Please fix these in a future update!

Game priority over PreMiD

I would like to be able to have my game status show up over my web activity because i listen to Soundcloud while playing games a lot and PreMiD displays instead of the game I'm playing. I would prefer to have the game displayed first, maybe make this toggleable?

Disable automatic presence activation

For certain partnered sites and the premid site, there should be an option to disable their presence being automatically shown. Maybe a 3rd option in the settings which could be "Disable Automatic Presences" something like that xd, you know what I mean.

Suggestion: Extension features

I would like for an option in the extension to allow when you click on your profile you can switch which Discord client it is hooked into. I run more than one client at a time and it gets a bit frustrating trying to get which client it goes through. I know this would benefit a lot of users like me who use more than one client at a time.

Another feature I would like to suggest is, I would like the feature to have an option on depending on which discord account is hooked into the extension all presences for that account would be enabled, and if you switch to another account the presence settings and the ones enabled for that account would change according to each account.
Example:
Discord account: user1234#0001
Presence's enabled: Youtube and Netflix
Settings: Youtube- privacy mode and show timestamps
Netflix- privacy mode

Discord account: user4567#0002
Presence's enabled: Reddit
Settings: Reddit: N/A

I would like for a 'profile' to be made per Discord account. I understand that many users only have one account but some have more than one and others have a family computer that they use and they use more than one account one on one computer.

Final suggestion: Option to export your settings and installed presence's to a file and enable cloud save or save with Chrome sync.
I recently had to reinstall a fresh version of Windows and When I added all my things back (yes I have chrome sync fully enabled) it did not have my presence's or settings synced. I had to add everything back manually. It would be great if this process had some form of automation.

I'm open to questions or anything.

Slow performance

Hello, I'm using the Premid extension (2.2.3) with the BBC provider on Firefox (105.0.3), and I noticed that the video was chugging and one of my CPU cores was pinned at 100%, after looking at the inspector it seems the getPageletiable function in the Premid extension is the issue.

In a 4.7s profile, the getPageletiable function was blocking the thread for 3.1s, being called over 3000 times.

https://profiler.firefox.com/public/azmxap2haf0g2j50nbdmxkvgy6z1zeyz2ffpff8/calltree/?globalTrackOrder=01&implementation=js&localTrackOrderByPid=87451-0~87503-0&thread=1&v=7

Precence request

Hi i saw it was no Precence for Opera Browser and i was wondering if u could add it to the Precence list it would be really helpfull, ty for listening :D

Reset presence settings after a while

Description

The extension resets the settings to default after some time

Operating System (OS)

Windows 11

Browser

Brave

Browser Version

Version 1.34.80 Chromium: 97.0.4692.71 (Official Build) (64-bit)

RPC hides itself after changing to another Tab with the Brave Browser

Describe the bug
When changing the focused Tab, the RPC hides itself after a few seconds. Happens only with Brave. Works fine with Chrome and Firefox.

To Reproduce
Steps to reproduce the behavior:

  1. Open the site of any corresponding presence
  2. wait for the RPC to appear
  3. change your Tab to any other Website
  4. wait a few seconds
  5. the RPC will disappear

Expected behavior
The RPC should stay when changing the Tab.

Desktop:

  • OS: Linux (Arch)
  • Browser: Brave
  • Version: 2.2.0.6 but also happens with 2.1.0

Additional Information
Developer Console does not print anything.
Backend Program says following when changing to another Tab:

Clear all activity
Create RPC client
Destroy RPC client

[Suggestion] Tips when something goes wrong

Display a notification whenever something goes wrong. Some examples:

No extension is installed
-> Give a link to the install page

Discord application is not installed
-> Give a link to Discord download page

Discord is modified (idk if this is detectable)
-> Display a warning

Everything is connected and the presence has been sent, but no presence is visible on the user.
-> Display a warning

Mozilla Addons "Store"

Looking over PreMiD for the first time. It looks pretty awesome. I'm curious though why the extension doesn't seem to be on https://addons.mozilla.org. It does seem to be on the Chrome store. I thought release versions of Firefox now would only install addons.mozilla.org-hosted XPIs, but actually it looks like I'm wrong. You can get signed and be self-hosted. Still, I'm curious why not on the Firefox store? I usually feel more hesitant to install extensions from other places.

[console logs] uBlock Origin kills Presence

(sry for text wall, I'm trying to provide a little more details to clarify more)

Everything is default configs, both chrome (recently installed) and premid. My pc is Win7 64bits 12GB RAM

I had to turn uBlock Origin off for premid to start working, and now the presence works and is active most of the time but randomly the presence disappears from my discord profile. It seems it happens on song switches but also randomly throughout songs.

I'm not entirely sure if it's uBlock, but pretty sure. My other extensions are Dark reader (not activated), Text to Speech and enhancer for youtube (not active on ytmusic).

I'm providing chrome console log, I saved it just as the error happened so if anything shows it should be at the end of the log.

I could provide ublock's log if it helps, I just wait for the error to happen then stop it.

I'm sending it because I don't know what error to search or what uBlock might be blocking that is breaking the presence.

So any help or info is greatly appreciated. I tried discord support ticket but they didn't know what to look for either, not their fault though, this is pretty obscure.

Thanks for the great app guys. My discord is 7777#6250

music.youtube.com-1606862539113.log

new change language method

First of all I want to inform you that I am Brazilian and my English may be very weak and I also had a great help from the translator.

I think it would be much better if there was a way to insert your preferred language for all the rich presences that have this function, so you wouldn't have to keep trying to insert a translation into the rich presences (in the gif I couldn't insert it).

firefox_TnTWQ0nNR3

Example

1674401315909

Safari / MacOS extension

So, I haven't looked much into how this would be done within the project but it might be an idea to implement PreMiD into a MacOS extension so you can update Discord whether I'm using Bear to write my notes or on looking at the App Store etc.

A Safari extension to allow for website presence is also a nice idea...

Language Selector not working (Brave)

Description

The language selector of the Genius, Twitch, Twitter and Discord presence doesn't appears.
image
image
image
image

But, it is displayed for the YouTube presence:
image

(I paste my screenshots here because the Screenshots section doesn't accept it.)

Steps to Reproduce

Just add the presences from the store.

Expected Behavior

image
The language selector is supposed to appear.

Screenshots

No response

Operating System (OS)

Windows 11

Browser

Brave

Browser Version

Version 1.33.80 Chromium: 96.0.4664.45 (Build officiel) beta (64 bits)

Additional Context

The "blocking trackers and ads" is disabled in Brave Shields. So, it isn't the responsible.

Don't use `.includes` to validate if a tab should be loaded into, maybe use `new URL(...).origin`

Steps to Reproduce

  1. go to https://www.fedex.com/fedextracking/ 2. check currently displayed presence on discord

Expected Behavior

No presence should be shown or previous valid presence should be shown

Actual Behavior

presence shows as being twitter, browsing fedextracking

Page URL

https://www.fedex.com/fedextracking/

Screenshots

image

Operating System

Windows 11 Build 22621

Browser and Version

Microsoft edge version 123.0.2420.65

Additional Comments

before i tested the bug again i made sure there was no twitter tabs open at the time

Sends last/current presence on app connection

When connected to the application and using a Presence, closing the application and starting the application again. On connection the extension will send the current /last used presence data

I.e if no presence is active send epmty presence data, etc

Steps to reproduce

  1. Use the application, extension and any presence
  2. Close the application
  3. Close the presence tab (no presence is active) whilst keeping the browser open
  4. Start the application

System: W11

Add own presence permantly to PreMiD

Is your feature request related to a problem? Please describe.
No, it's not problem. I must always add my presence manually to PreMiD.

Describe the solution you'd like
I think best idea is, you can add owns presences permantly to the PreMiD. Example me, i don't want share my own presence for all users. I only want use it.

Describe alternatives you've considered
Some button where you can add your own presence. You can choose your presence, and load it.

Additional context
Nope, i don't have. I would be happy if this were possible.
Thanks!

firefox issue

Hello, I dont know why when i download the extension from Firefox, the file would be a xpi document, which i cannot open on my mac.

[Suggestion] Presence suggestion

It'd be cool if there was a section in the extension pop-up with suggested Presences, if there are any. It would suggest to install the Google Presence if the user is on google.com and they don't have it yet. And the GitHub Presence when they're on github.com.

Aniflix automatic Presence activation Bug

Is your bug request related to a problem? Please describe.

Aniflix is partnered with Premid so the presence is automatically added when you open the page but due to special circumstances it should be disabled on my system.
I have tried to turn it off but every time I go to the site or click on a new Episode it is back on again.
premid 1

Describe the solution you'd like

A Button that can deactivate the "Automatic Presence Activation"
premid 2

Describe alternatives you've considered

Additional context

Google Chrome
Version 92.0.4515.131 (Official Build) (64-Bit)
Windows 10 Version 21H1 for x64-based Systems
Premid Extension 2.2.3
PreMid Application 2.2.0
Screen 1 is the problems Picture
Screen 2 is the solution Picture

RPC keeps showing even after I switch/close tab

I use only 2 presences, AniMixPlay and Twitch, both of them keep sticking to my Discord profile even after I switch tabs or even close them, it eventually closes (sometimes doesn't at all) but it's so random, sometimes it closes after a couple of minutes, some times an hour, sometimes even more

What it's supposed to do: Remove the presence from profile as soon as I switch/close the tab with the presence, or add an option for every presence (or all presences if adding the setting for everyone would be a pain) to toggle the sticky presence thing, whether it should keep the presence even when you switch tabs or not, and for closing tabs I don't think it should keep the presence at all, that's clearly a bug, and I don't know if someone else is having it.

Version: PreMiD v2.2.0 | Ext v2.2.3
OS: Windows 10 64-Bit Version 21H1
Browser: Google Chrome Version 104.0.5112.81 (Official Build) (64-bit)

Dead Link

In the Not Connected section of PreMiD, when I click the Troubleshooting hyperlink, I get a Page Not Found link instead of the real troubleshooting link.
Steps to recreate the bug:

  1. Make sure that PreMiD is not connected
  2. Hover the cursor on the yellow exclamation mark and click on the troubleshooting hyperlink

Weird bug/glitch

Hi, I was asked to send my issue here. I recently switched from Chrome to Microsoft Edge, I added my presences in and went on my day. After a few days, I went to see if my discord is showing Webtoon but it didn't, I went and looked at the extension to find all my added presences were removed and just the default ones are left. I added them back though but it is just really weird to suddenly get all my presences removed.

Set higher Priority for Services

I know i am suggesting a lot but i got a lot of ideas for this and i wanna see it grow.
Is your feature request related to a problem? No
Allow users to select or order sites into priority like if i was watching a YouTube video but listening to YouTube Music, YouTube Music would show instead of YouTube. Sorry for my shit explanation but hopefully you understand.

[BUG] Presence Setting Got Reseted

Description: Setting in the extension gets reset every time I install another presence from the store.

Steps to Reproduce:

  1. Change the YouTube presence setting to Privacy Mode.
  2. Install another presence from the store.
  3. The YouTube presence setting gets reset.

Expected Result: The YouTube setting should still be in Privacy Mode.

Available Presence

Is your feature request related to a problem? Please describe.
Its annoying to have to go to the premid store to get a presence when you're already on the site

Describe the solution you'd like
When you're on a site that has an available presence the extension should show a little notifier addon to the icon (kinda like unread for discord), and if you open it there should be the presence modal so you can install it without leaving the site

Describe alternatives you've considered
A "This Website has an available presence" message with a link to the store page that opens in a new tab (still in the popup, still preferably with the icon change)

Additional context
The icon change would be kinda like this, only not a number but a circle or something
image
(Stylus Extension)

PreMiD shows closed service after suspend

After suspending PC and waking it up with browser open, if there is no PreMiD service open, PreMiD reports the last known one, usually, one that is closed.

Workaround for this is to open one of PreMiD services, wait for the status to change to it, and then close it. Then PreMiD returns back to normal.

SyntaxError: redeclaration of let Presence (Firefox)(Youtube)

SyntaxError: redeclaration of let Presence devHelper.js:1:1
    <anonymous> moz-extension://a5d8464a-889e-4ce4-81e1-288676c35fb3/js/devHelper.js:1
    inject resource://gre/modules/ExtensionContent.sys.mjs:581
    AsyncFunctionNext self-hosted:852

This happens every time i go to youtube on firefox

More info

"application": {
    "name": "Firefox",
    "osVersion": "Windows_NT 10.0 22621",
    "version": "117.0b2",
    "buildID": "20230801180159",
    "distributionID": "",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0",
    "safeMode": false,
    "memorySizeBytes": 17115049984,
    "diskAvailableBytes": 158823915520,
    "updateChannel": "aurora",
    "supportURL": "https://support.mozilla.org/1/firefox/117.0/WINNT/es-ES/",
    "pointingDevices": [
      "pointing-device-pen-digitizer",
      "pointing-device-mouse"
    ],
    "fissionAutoStart": true,
    "fissionDecisionStatus": "enabledByDefault",
    "remoteAutoStart": true,
    "keyLocationServiceGoogleFound": true,
    "keySafebrowsingGoogleFound": true,
    "keyMozillaFound": true
  }

[Suggestion] Feedback button

A button in the application menu called "Give Feedback" or "What do you think?", which would ask the user for a rating and a comment. These would get added up to a average rating. This can give staff insights on how to handle things better.

Dynamic RPC depending on the active window and Browser tab

Is your feature request related to a problem? Please describe.
This is mainly an enhancement on PreMiD's reliability for the sites you're actually visiting and a site that may be open in background
I don't know if it is possible, but if it is it'd be a really really nice feature

Describe the solution you'd like
Instead of showing the RPC for the last website you have opened you could make the check more strict by checking if the website is in the active tab of the browser AND/OR if the browser window is focused or not; In case these conditions are not met you could completly hide the RPC

Describe alternatives you've considered
If you don't like the idea of this enhancement, you could always make it a configurable option that someone can enable if they want (like: "Enable Browser Window & Tab Watcher")

Language selector

Describe the solution you'd like
Would be good if there's option to select language you want presences to display manually . I prefer it in English but it uses system language.

qwD8p0K

Self-hosted website support

Add support for presences to work with self hosted websites that depends on domain names (without any way to identify the website using just by its URL).

Link to the discussion we had about that on the Discord server for more details.

[Bug] Presences not working when Presence getStrings() non-English localization string

This issue causes users with non-English browsers to be unable to use most of the Presences that presence.getStrings() non-English strings

Some Presences have solved this issue using .catch fallback to English like:

But some not:

To Reproduce

  1. Change browser language to Chinese Simplified or Chinese Traditional (The choice of language depends on whether the string has been translated or not?)
  2. Install SoundCloud or other Presence that calls getStrings() but does not fallback to English by default
  3. Try to trigger Presence, Presence not working
  4. Switch the browser language back to English
  5. Return to the previous page (Step 3), Presence should be working now.

Solution

Alright, so I know we can don't even bother to use localized strings if it's just paused and playing! But lots of the simple Presence is called localized strings, and if we want to fix them all we must change them all one by one. Extensions should probably fall back to English by themselves if the localization string for the user's browser language does not exist, instead of directly causing Presence to not work

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.