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

Update Manifest version from v2 to v3 #326

Open
inson1 opened this issue Oct 23, 2023 · 5 comments
Open

Update Manifest version from v2 to v3 #326

inson1 opened this issue Oct 23, 2023 · 5 comments
Assignees

Comments

@inson1
Copy link

inson1 commented Oct 23, 2023

No description provided.

@nascentt
Copy link

nascentt commented Mar 7, 2024

V2 is being deprecated June 2024 https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline
so 3 months left to migrate.

@KevinRoebert
Copy link
Member

V2 is being deprecated June 2024 https://developer.chrome.com/docs/extensions/develop/migrate/mv2-deprecation-timeline so 3 months left to migrate.

The onBeforeRequest API will be removed from Chrome with V3. This means that ClearURLs no longer works in Chrome. As for many other ad blockers and privacy addons, there is no alternative to replace this functionality. ClearURLs will therefore only work in Firefox and Chromium-based browsers that continue to offer the onBeforeRequest API.

@KevinRoebert
Copy link
Member

@KevinRoebert Isn't the onBeforeRequest API used by ClearURLs only to redirect urls? In fact even in manifest V3, it is possible to use declarativeNetRequest to redirect to different URLs.

There is a official code example on Github exclusively for this: https://github.com/GoogleChrome/chrome-extensions-samples/tree/main/api-samples/declarativeNetRequest/url-redirect

See the google article to block and or redirect urls: https://developer.chrome.com/docs/extensions/develop/migrate/blocking-web-requests

EXAMPLE IN MANIFEST V2:

chrome.webRequest.onBeforeRequest.addListener((e) => {
    console.log(e);
    return { redirectUrl: "https://developer.chrome.com/docs/extensions/mv3/intro/" };
  }, { 
    urls: [
      "https://developer.chrome.com/docs/extensions/mv2/"
    ]
  }, 
  ["blocking"]
);

THE SAME EXAMPLE IN MANIFEST V3:

[
  {
    "id" : 1,
    "priority": 1,
    "action": {
      "type": "redirect",
      "redirect": { "url": "https://developer.chrome.com/docs/extensions/mv3/intro/" }
    },
    "condition": {
      "urlFilter": "https://developer.chrome.com/docs/extensions/mv2/",
      "resourceTypes": ["main_frame"]
    }
  }

It is primarily used to filter the tracking parameters.

@deathtrip
Copy link

So if it's possible, will ClearURLs work with manifest V3?

@subham8907
Copy link

As CleanURLs won't work with Chrome MV3, I've created a comparable extension using the MV3 framework. I invite you to join our project at Linkumori on GitHub. https://github.com/subham8907/Linkumori

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants