Create a manifest V3 code for an Edge and Chrome extension with the following functionality:

Functionality Overview:
Trigger Shortcut:

When the user holds the Alt key first and then holds the left mouse button (prevents text selection when holding alt key and hold left mouse),
and then dragging the mouse  will display a rectangular dashed selection area with a red border with a border size of 4 (transparent inside, only the border has color).

Highlight Links:

All clickable links (such as image links or text links) within the selection area will have a blue dashed border (transparent inside, only the border has color) with a border size of 4.

Link Count Display:

The number of links within the selection area will be displayed in the bottom-right corner of the selection area with a black background and white text (text size 18).

Link Opening Behavior:

If the user releases the Alt key first, the selection area is canceled without opening any links.

If the user releases the left mouse button while holding the Alt key  (rules of open link), all links within the selection area will open in new tabs from the current tab.

Extension Options:

An option to add elements to detect links within input boxes (in format like "li.shopee-search-item-result__item 
.article-name,
.article-link," also add that into inputbox by default and make sure it will work with that element ) and for example link in shopee grid item
"##li.shopee-search-item-result__item.col-xs-2-4:nth-of-type(6)
,##li.shopee-search-item-result__item.col-xs-2-4:nth-of-type(5)
,##.text-sm.min-h-\[2\.5rem\].break-words.line-clamp-2" ,for ##li.shopee-search-item-result__item.col-xs-2-4:nth-of-type(this part can be different) ,make sure it will by default with this element, and when user select and drag over that add element and release left mouse (match rules of open link) it will open that add element too (it show highlights and open link).

Auto-save changes to the extension's options.

Script Execution:
The script is activated when both the trigger keys (Alt and left mouse button) are held down.

The selection area appears while dragging the mouse (it will show from when first mouse drag and maintain that point until user release alt key ,it will not repeat show old value area).

Releasing the Alt key cancels the selection area (make sure it will not show same selection area if user release alt key it should show only if user hold alt and hold left mouse and drag it will always show area where left mouse is first hold and drag from that not just hold or click both alt and left mouse but drag too).

Opening Tabs to the Right of the Current Tab:
When the user releases the left mouse button while holding the Alt key, the extension should open all unique links within the selection area in new tabs to the right of the current tab, preserving tab order and without change tab focus (the browser will try to switch tab to newly open link ,make sure it does not switch tab ,active tab is be the same when open new tab link) and if link open more then 20 link show dialog confirm if user click ok will open all link, and it will not count and open duplicate link.

and when user hold alt + hold left mouse and drag to top or bottom edge it will auto scroll down at bottom or up at the top while selection area still update and cover more link (make it smooth scrolling and fast).

,explain first then show complete code.