Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Vencord in Mica-Discord #10

Open
kronuschan opened this issue Jul 29, 2023 · 1 comment
Open

Add support for Vencord in Mica-Discord #10

kronuschan opened this issue Jul 29, 2023 · 1 comment
Labels
wontfix This will not be worked on

Comments

@kronuschan
Copy link

Hello, not sure if Mica Discord is still being updated but would it be possible to add support for Vencord?

Vencord is an open source BetterDiscord alternative, it also has plugin support. It can be found here: https://github.com/Vendicated/Vencord & here: https://vencord.dev/

I think it should be possible, but I have no idea how to go about implementing it into the codebase myself. I tried to add it manually and reference it in the code like you are doing but nothing seems to change in the final build. The official repo has a JS and a CSS in the releases and also supports being run as a user script, does webview2 support this kind of thing and would it be hard to implement? It would make using Mica Discord that much better.

@GetGet99
Copy link
Owner

GetGet99 commented Oct 7, 2023

Mica Discord is currently not receiving updates because I have no reason to update it. It does the job that I wanted it to do.

With that said, I don't think I will add Vencord in Mica Discord because I don't want Mica Discord to be anything else other than customization. I do not endorse having any custom code touching Discord APIs and do not want this project to touch those.

However, if you still want to, feel free to fork and do this in a separate repository or do this locally in your computer.

It seems like Vencord provides a browser extension version as I read their github repo. So, you need to install extension in WebView2. However, WebView2 currently only has experimental support for extension,. Here's a general guideline of how to do this.

  1. Download and Install Microsoft Edge Canary (because WebView2 experimental version requires you to have edge canary)
  2. Install Vencord extension in any Chromium based browser
  3. Open your user profile folder, navigate to the extension folder. Copy the folder with the name of the extension ID to somewhere in your computer (DO NOT delete this folder if you are still going to use the extension)
  4. Inside the project, update Microsoft.Web.WebView2 package to the latest experimental version
  5. In MainWindow InitializeAsync method,
        async void InitializeAsync()
        {
            if (WebView == null) return;
            System.Environment.SetEnvironmentVariable("WEBVIEW2_RELEASE_CHANNEL_PREFERENCE", "1");
            var env = await CoreWebView2Environment.CreateAsync(options: new CoreWebView2EnvironmentOptions()
            {
                AreBrowserExtensionsEnabled = true
            });
            await WebView.EnsureCoreWebView2Async(env);
            WebView.Source = new Uri(@"https://discord.com/channels/@me");
            await WebView.CoreWebView2.Profile.AddBrowserExtensionAsync(@"Drive://path/to/extension folder/the version number inside the extension folder");
        }
  1. Build and Run Mica Discord. If there's a setup window or something complete the setup.
  2. Delete or comment out this line. We already finish adding the extension and we don't need to add again.
await WebView.CoreWebView2.Profile.AddBrowserExtensionAsync(@"Drive://path/to/extension folder/the version number inside the extension folder");
  1. Enjoy. You can also do this with other extension than Vencord as well

You can close the issue if you resolve this. Otherwise I will keep this open in case you want to ask any additional question. Not confirming though when will I actually respond back as you can see that I did not reply to your issue for like 3 months I think. I'm normally active more on the Discord server though.

@GetGet99 GetGet99 added the wontfix This will not be worked on label Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants