question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Failed to load extension (.NET)

See original GitHub issue

does loading extension still work?

because it seems that its prefixing google chrome path from the actual extension path which makes it fail.

Im getting this error when launching playwright.

---------------------------
Error Loading Extension
---------------------------
Failed to load extension from: C:\Program Files (x86)\Google\Chrome\Application\108.0.5359.125\"D:\Projects\.NET Shared Codes\scraptest2playwrite\scraptest2playwrite\bin\Debug\chrome-extensions\ublock-origin-lite-chrome". Manifest file is missing or unreadable
---------------------------
OK   
---------------------------

its prefixing chrome path *C:\Program Files (x86)\Google\Chrome\Application\108.0.5359.125* from my actual extension path.

heres the command line i used in loading;

--disable-extensions-except="D:\Projects\.NET Shared Codes\scraptest2playwrite\scraptest2playwrite\bin\Debug\chrome-extensions\ublock-origin-lite-chrome" 
--load-extension="D:\Projects\.NET Shared Codes\scraptest2playwrite\scraptest2playwrite\bin\Debug\chrome-extensions\ublock-origin-lite-chrome" 
' lstArgs here contains the command line above;

        Dim config As New BrowserTypeLaunchPersistentContextOptions
        With config
            .Channel = "chrome"
            .Locale = "en-US"
            .Headless = False
            .Devtools = True
            .DownloadsPath = Path.GetFullPath(".\chrome-downloads")
            .Args = lstArgs
            .IgnoreDefaultArgs = {"--disable-extensions"}
            .JavaScriptEnabled = True
        End With
        
        Dim PL = Playwright.CreateAsync().Result
        Dim browser = PL.Chromium.LaunchPersistentContextAsync(Path.GetFullPath(".\chrome-data"), config).Result

Im using .net 4.6.1, and 1.28.0 version of playwright nugget,

anyone?

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mxschmittcommented, Jan 5, 2023

Yes it should work, did you see the error? Manifest file is missing or unreadable

0reactions
salvadorjhaicommented, Jan 16, 2023

The following works for me, it contains spaces and brackets:

using Microsoft.Playwright;

using var playwright = await Playwright.CreateAsync();
var extensionPath = "C:\\Users\\maxschmitt\\development\\playwright-dotnet\\src\\Playwright.Tests.TestServer\\assets\\simple-extension (81)";
await using var context = await playwright.Chromium.LaunchPersistentContextAsync("", new(){
    Headless = false,
    Args = new[] {
        $"--disable-extensions-except={extensionPath}",
        $"--load-extension={extensionPath}"
    },
});
await context.Pages[0].PauseAsync();

Looks like in your case the issue is that you did not escape the slashes.

FINALLY it works… lol case solved. thanks…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Top 7 Ways to Fix Google Chrome Failed to Load Extension
Top 7 Ways to Fix Google Chrome Failed to Load Extension · 1. Restart Google Chrome · 2. Update Extension · 3. Reinstall...
Read more >
7 Reasons Why Chrome Fails to Load Extensions and How ...
If you've been experiencing some problems with Chrome extensions, here are seven reasons why Chrome might not be loading them properly.
Read more >
Failed to Load Extension From Chrome: How to Fix it
When Chrome failed to load an extension, check them all and remove the problematic one, or reinstall the browser altogether to fix things....
Read more >
4 Ways to Fix the “Failed to Load Resource: net
Learn how to fix the "Failed to Load Resource: net::ERR_BLOCKED_BY_CLIENT" error. We'll show you 4 different methods to fix this error.
Read more >
How to Fix If Chrome Fails to Load Extensions
How to Fix If Chrome Fails to Load Extensions · Method 1: Reinstall Google Chrome · Method 2: Activate your extensions one-by-one ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found