Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
iphone x used
AssassiN1
Updated:
Yesterday at 10:30 PM
කිතුල් තලප
Manoj Suranga Bandara
Updated:
Saturday at 7:04 PM
Ad icon
ව්යාපාර, Tuition පන්ති සහ Personal Portfolios සඳහා Web Setup එකක් රු. 9,099/- කට (වාර්ෂික renewal ර
thathsilura
Updated:
Thursday at 6:17 PM
AWS Certified Solutions Architect-Associate + AWS Certified Cloud Practitioner
Sanjeewani95
Updated:
Aug 19, 2026
🚀 එක පැකේජ් එකයි - මාසෙටම Unlimited Internet! 🌐
sayuru bandara
Updated:
Aug 18, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
Instagram එකේ ෆොටෝස් full size එකට ඔන් කරන්න DIY ච්රෝමේ extension එකක්
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Monkey D Dragon" data-source="post: 31389357" data-attributes="member: 587008"><p>මේ විදිහට folder එකක් හදන්න</p><p>ඒක ඇතුලේ "icons" folder එකත් හදන්න images වලට paint වලින් මොනවා හරි png ටිකක් හදලා resolutions දාන්න match වෙන්න</p><p></p><p>open-original-image/</p><p>├── manifest.json # Extension manifest (Manifest V3)</p><p>├── background.js # Service worker — creates context menu, handles clicks</p><p>├── content.js # Content script — finds the real image under cursor</p><p>└── icons/</p><p> ├── icon16.png # resolution 16x16</p><p> ├── icon48.png # resolution 48x48</p><p> └── icon128.png # resolution 128x128</p><p></p><p>මේ files note pad එකෙන් හදලා හරි extension එක්ක save කරන්න </p><p></p><p>manifest.json</p><p>[CODE=json]{</p><p> "manifest_version": 3,</p><p> "name": "Open Original Image — Instagram",</p><p> "version": "1.0",</p><p> "description": "Right-click any image on Instagram and open the full-resolution original in a new tab.",</p><p> "permissions": ["contextMenus", "activeTab"],</p><p> "icons": {</p><p> "16": "icons/icon16.png",</p><p> "48": "icons/icon48.png",</p><p> "128": "icons/icon128.png"</p><p> },</p><p> "background": {</p><p> "service_worker": "background.js"</p><p> },</p><p> "content_scripts": [</p><p> {</p><p> "matches": ["*://*.instagram.com/*"],</p><p> "js": ["content.js"],</p><p> "run_at": "document_idle"</p><p> }</p><p> ]</p><p>}</p><p>[/CODE]</p><p></p><p>background.js</p><p>[CODE=javascript]// Create context menu item on install</p><p>chrome.runtime.onInstalled.addListener(() => {</p><p> chrome.contextMenus.create({</p><p> id: "open-original-image",</p><p> title: "Open Original Image in New Tab",</p><p> contexts: ["all"],</p><p> documentUrlPatterns: ["*://*.instagram.com/*"]</p><p> });</p><p>});</p><p></p><p>// Handle context menu click</p><p>chrome.contextMenus.onClicked.addListener((info, tab) => {</p><p> if (info.menuItemId !== "open-original-image") return;</p><p></p><p> // Ask the content script for the image URL at the last right-click position</p><p> chrome.tabs.sendMessage(tab.id, { action: "getImageUrl" }, (response) => {</p><p> if (chrome.runtime.lastError) {</p><p> console.warn("Content script not reachable:", chrome.runtime.lastError.message);</p><p> return;</p><p> }</p><p></p><p> if (response && response.url) {</p><p> chrome.tabs.create({ url: response.url, active: false });</p><p> }</p><p> });</p><p>});</p><p>[/CODE]</p><p></p><p>content.js</p><p></p><p>[CODE=javascript]/**</p><p> * Instagram Image Finder — Content Script</p><p> *</p><p> * Tracks the last right-click position, then on demand walks</p><p> * the DOM stack at those coordinates to find the real <img> element</p><p> * (even under Instagram's overlay divs) and returns the highest</p><p> * resolution URL from srcset.</p><p> */</p><p></p><p>let lastX = 0;</p><p>let lastY = 0;</p><p></p><p>// Track every contextmenu event to know exactly where the user right-clicked</p><p>document.addEventListener("contextmenu", (e) => {</p><p> lastX = e.clientX;</p><p> lastY = e.clientY;</p><p>}, true);</p><p></p><p>/**</p><p> * Parse a srcset string and return the URL with the largest width descriptor.</p><p> * Falls back to the last entry if no width descriptors are found.</p><p> */</p><p>function getHighestResSrcsetUrl(srcset) {</p><p> if (!srcset) return null;</p><p></p><p> const candidates = srcset.split(",").map((entry) => {</p><p> const parts = entry.trim().split(/\s+/);</p><p> const url = parts[0];</p><p> const descriptor = parts[1] || "";</p><p> const width = parseInt(descriptor, 10) || 0;</p><p> return { url, width };</p><p> });</p><p></p><p> if (candidates.length === 0) return null;</p><p></p><p> // Sort descending by width, pick the largest</p><p> candidates.sort((a, b) => b.width - a.width);</p><p> return candidates[0].url;</p><p>}</p><p></p><p>/**</p><p> * Given a DOM element, try to extract the best image URL from it.</p><p> * Checks: <img> src/srcset, CSS background-image.</p><p> */</p><p>function extractImageUrl(el) {</p><p> if (!el) return null;</p><p></p><p> // Direct <img> element</p><p> if (el.tagName === "IMG") {</p><p> const srcsetUrl = getHighestResSrcsetUrl(el.srcset);</p><p> if (srcsetUrl) return srcsetUrl;</p><p> if (el.src) return el.src;</p><p> }</p><p></p><p> // CSS background-image</p><p> const bg = getComputedStyle(el).backgroundImage;</p><p> if (bg && bg !== "none") {</p><p> const match = bg.match(/url\(["']?(.*?)["']?\)/);</p><p> if (match && match[1]) return match[1];</p><p> }</p><p></p><p> return null;</p><p>}</p><p></p><p>/**</p><p> * Main finder: walks through all elements at the click point,</p><p> * then searches their subtrees for <img> elements.</p><p> */</p><p>function findImageAtPoint(x, y) {</p><p> // 1. Get all elements stacked at this coordinate (pierces overlays)</p><p> const stack = document.elementsFromPoint(x, y);</p><p></p><p> // 2. First pass — check if any element in the stack IS an <img></p><p> for (const el of stack) {</p><p> const url = extractImageUrl(el);</p><p> if (url) return url;</p><p> }</p><p></p><p> // 3. Second pass — for each element in the stack, look for <img> children</p><p> // This catches Instagram's pattern: overlay div sits above, <img> is a sibling/child</p><p> for (const el of stack) {</p><p> // Check the element's parent container for nearby <img> tags</p><p> const container = el.closest("div");</p><p> if (container) {</p><p> const imgs = container.querySelectorAll("img");</p><p> for (const img of imgs) {</p><p> const url = extractImageUrl(img);</p><p> if (url) return url;</p><p> }</p><p> }</p><p> }</p><p></p><p> // 4. Third pass — walk up the tree further, looking for the post/story container</p><p> for (const el of stack) {</p><p> // Instagram uses <article> for feed posts</p><p> const article = el.closest("article");</p><p> if (article) {</p><p> // Find all images within the article, pick the one closest to click point</p><p> const imgs = article.querySelectorAll("img");</p><p> let bestUrl = null;</p><p> let bestDistance = Infinity;</p><p></p><p> for (const img of imgs) {</p><p> // Skip tiny images (profile pics, icons — usually < 40px)</p><p> if (img.naturalWidth > 0 && img.naturalWidth < 40) continue;</p><p> if (img.width < 40 && img.height < 40) continue;</p><p></p><p> const rect = img.getBoundingClientRect();</p><p> // Check if click point is inside this image's bounds</p><p> if (x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom) {</p><p> const url = extractImageUrl(img);</p><p> if (url) return url;</p><p> }</p><p></p><p> // Otherwise measure distance</p><p> const cx = rect.left + rect.width / 2;</p><p> const cy = rect.top + rect.height / 2;</p><p> const dist = Math.hypot(x - cx, y - cy);</p><p> if (dist < bestDistance) {</p><p> bestDistance = dist;</p><p> bestUrl = extractImageUrl(img);</p><p> }</p><p> }</p><p></p><p> if (bestUrl) return bestUrl;</p><p> }</p><p> }</p><p></p><p> return null;</p><p>}</p><p></p><p>// Listen for messages from the background service worker</p><p>chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {</p><p> if (message.action === "getImageUrl") {</p><p> const url = findImageAtPoint(lastX, lastY);</p><p> sendResponse({ url: url || null });</p><p> }</p><p> return true; // keep channel open for async response</p><p>});</p><p>[/CODE]</p><p></p><p></p><p></p><p></p><p>You can then load it in Chrome via chrome://extensions → <strong>Developer mode</strong> → <strong>Load unpacked</strong> → point to that folder.</p></blockquote><p></p>
[QUOTE="Monkey D Dragon, post: 31389357, member: 587008"] මේ විදිහට folder එකක් හදන්න ඒක ඇතුලේ "icons" folder එකත් හදන්න images වලට paint වලින් මොනවා හරි png ටිකක් හදලා resolutions දාන්න match වෙන්න open-original-image/ ├── manifest.json # Extension manifest (Manifest V3) ├── background.js # Service worker — creates context menu, handles clicks ├── content.js # Content script — finds the real image under cursor └── icons/ ├── icon16.png # resolution 16x16 ├── icon48.png # resolution 48x48 └── icon128.png # resolution 128x128 මේ files note pad එකෙන් හදලා හරි extension එක්ක save කරන්න manifest.json [CODE=json]{ "manifest_version": 3, "name": "Open Original Image — Instagram", "version": "1.0", "description": "Right-click any image on Instagram and open the full-resolution original in a new tab.", "permissions": ["contextMenus", "activeTab"], "icons": { "16": "icons/icon16.png", "48": "icons/icon48.png", "128": "icons/icon128.png" }, "background": { "service_worker": "background.js" }, "content_scripts": [ { "matches": ["*://*.instagram.com/*"], "js": ["content.js"], "run_at": "document_idle" } ] } [/CODE] background.js [CODE=javascript]// Create context menu item on install chrome.runtime.onInstalled.addListener(() => { chrome.contextMenus.create({ id: "open-original-image", title: "Open Original Image in New Tab", contexts: ["all"], documentUrlPatterns: ["*://*.instagram.com/*"] }); }); // Handle context menu click chrome.contextMenus.onClicked.addListener((info, tab) => { if (info.menuItemId !== "open-original-image") return; // Ask the content script for the image URL at the last right-click position chrome.tabs.sendMessage(tab.id, { action: "getImageUrl" }, (response) => { if (chrome.runtime.lastError) { console.warn("Content script not reachable:", chrome.runtime.lastError.message); return; } if (response && response.url) { chrome.tabs.create({ url: response.url, active: false }); } }); }); [/CODE] content.js [CODE=javascript]/** * Instagram Image Finder — Content Script * * Tracks the last right-click position, then on demand walks * the DOM stack at those coordinates to find the real <img> element * (even under Instagram's overlay divs) and returns the highest * resolution URL from srcset. */ let lastX = 0; let lastY = 0; // Track every contextmenu event to know exactly where the user right-clicked document.addEventListener("contextmenu", (e) => { lastX = e.clientX; lastY = e.clientY; }, true); /** * Parse a srcset string and return the URL with the largest width descriptor. * Falls back to the last entry if no width descriptors are found. */ function getHighestResSrcsetUrl(srcset) { if (!srcset) return null; const candidates = srcset.split(",").map((entry) => { const parts = entry.trim().split(/\s+/); const url = parts[0]; const descriptor = parts[1] || ""; const width = parseInt(descriptor, 10) || 0; return { url, width }; }); if (candidates.length === 0) return null; // Sort descending by width, pick the largest candidates.sort((a, b) => b.width - a.width); return candidates[0].url; } /** * Given a DOM element, try to extract the best image URL from it. * Checks: <img> src/srcset, CSS background-image. */ function extractImageUrl(el) { if (!el) return null; // Direct <img> element if (el.tagName === "IMG") { const srcsetUrl = getHighestResSrcsetUrl(el.srcset); if (srcsetUrl) return srcsetUrl; if (el.src) return el.src; } // CSS background-image const bg = getComputedStyle(el).backgroundImage; if (bg && bg !== "none") { const match = bg.match(/url\(["']?(.*?)["']?\)/); if (match && match[1]) return match[1]; } return null; } /** * Main finder: walks through all elements at the click point, * then searches their subtrees for <img> elements. */ function findImageAtPoint(x, y) { // 1. Get all elements stacked at this coordinate (pierces overlays) const stack = document.elementsFromPoint(x, y); // 2. First pass — check if any element in the stack IS an <img> for (const el of stack) { const url = extractImageUrl(el); if (url) return url; } // 3. Second pass — for each element in the stack, look for <img> children // This catches Instagram's pattern: overlay div sits above, <img> is a sibling/child for (const el of stack) { // Check the element's parent container for nearby <img> tags const container = el.closest("div"); if (container) { const imgs = container.querySelectorAll("img"); for (const img of imgs) { const url = extractImageUrl(img); if (url) return url; } } } // 4. Third pass — walk up the tree further, looking for the post/story container for (const el of stack) { // Instagram uses <article> for feed posts const article = el.closest("article"); if (article) { // Find all images within the article, pick the one closest to click point const imgs = article.querySelectorAll("img"); let bestUrl = null; let bestDistance = Infinity; for (const img of imgs) { // Skip tiny images (profile pics, icons — usually < 40px) if (img.naturalWidth > 0 && img.naturalWidth < 40) continue; if (img.width < 40 && img.height < 40) continue; const rect = img.getBoundingClientRect(); // Check if click point is inside this image's bounds if (x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom) { const url = extractImageUrl(img); if (url) return url; } // Otherwise measure distance const cx = rect.left + rect.width / 2; const cy = rect.top + rect.height / 2; const dist = Math.hypot(x - cx, y - cy); if (dist < bestDistance) { bestDistance = dist; bestUrl = extractImageUrl(img); } } if (bestUrl) return bestUrl; } } return null; } // Listen for messages from the background service worker chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { if (message.action === "getImageUrl") { const url = findImageAtPoint(lastX, lastY); sendResponse({ url: url || null }); } return true; // keep channel open for async response }); [/CODE] You can then load it in Chrome via chrome://extensions → [B]Developer mode[/B] → [B]Load unpacked[/B] → point to that folder. [/QUOTE]
Insert quotes…
Verification
Hathara warak wissa keeyada? (Hathara wadi karanna 20)
Post reply
Top
Bottom