Unverified Commit 90241ecb authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #226343 from FlafyDev/webcord-vencord

parents 3edbda23 75d51afa
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -5135,6 +5135,12 @@
    github = "fkautz";
    githubId = 135706;
  };
  FlafyDev = {
    name = "Flafy Arazi";
    email = "flafyarazi@gmail.com";
    github = "FlafyDev";
    githubId = 44374434;
  };
  Flakebi = {
    email = "flakebi@t-online.de";
    github = "Flakebi";
@@ -11299,6 +11305,12 @@
    githubId = 3521180;
    name = "Tom Sydney Kerckhove";
  };
  NotAShelf = {
    name = "NotAShelf";
    email = "itsashelf@gmail.com";
    github = "NotAShelf";
    githubId = 62766066;
  };
  notbandali = {
    name = "Amin Bandali";
    email = "bandali@gnu.org";
+12 −0
Original line number Diff line number Diff line
diff --git a/sources/code/common/main.ts b/sources/code/common/main.ts
index 3936ee0..bd745ef 100644
--- a/sources/code/common/main.ts
+++ b/sources/code/common/main.ts
@@ -358,6 +358,7 @@ app.userAgentFallback = getUserAgent(process.versions.chrome, userAgent.mobile,
 const singleInstance = app.requestSingleInstanceLock();
 
 function main(): void {
+  session.defaultSession.loadExtension("@vencord@");
   if (overwriteMain) {
     // Execute flag-specific functions for ready application.
     overwriteMain();
+18 −0
Original line number Diff line number Diff line
{ webcord
, substituteAll
, callPackage
, lib
}:
webcord.overrideAttrs (old: {
  patches = (old.patches or [ ]) ++ [
    (substituteAll {
      src = ./add-extension.patch;
      vencord = callPackage ./vencord-web-extension { };
    })
  ];

  meta = with lib; old.meta // {
    description = "Webcord with Vencord web extension";
    maintainers = with maintainers; [ FlafyDev NotAShelf ];
  };
})
+60 −0
Original line number Diff line number Diff line
{ buildNpmPackage
, fetchFromGitHub
, lib
, substituteAll
, esbuild
, buildGoModule
}:
buildNpmPackage rec {
  pname = "vencord-web-extension";
  version = "1.1.6";

  src = fetchFromGitHub {
    owner = "Vendicated";
    repo = "Vencord";
    rev = "v${version}";
    sha256 = "sha256-V9fzSoRqVlk9QqpzzR2x+aOwGHhQhQiSjXZWMC0uLnQ=";
  };

  ESBUILD_BINARY_PATH = lib.getExe (esbuild.override {
    buildGoModule = args: buildGoModule (args // rec {
      version = "0.15.18";
      src = fetchFromGitHub {
        owner = "evanw";
        repo = "esbuild";
        rev = "v${version}";
        hash = "sha256-b9R1ML+pgRg9j2yrkQmBulPuLHYLUQvW+WTyR/Cq6zE=";
      };
      vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
    });
  });

  # Supresses an error about esbuild's version.
  npmRebuildFlags = [ "|| true" ];

  npmDepsHash = "sha256-jKSdeyQ8oHw7ZGby0XzDg4O8mtH276ykVuBcw7dU/Ls=";
  npmFlags = [ "--legacy-peer-deps" ];
  npmBuildScript = "buildWeb";

  prePatch = ''
    cp ${./package-lock.json} ./package-lock.json
  '';

  patches = [
    (substituteAll {
      src = ./replace-git.patch;
      inherit version;
    })
  ];

  installPhase = ''
    cp -r dist/extension-unpacked $out
  '';

  meta = with lib; {
    description = "Vencord web extension";
    homepage = "https://github.com/Vendicated/Vencord";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ FlafyDev NotAShelf ];
  };
}
+4983 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading