-
Pakistan fuel prices, 2026 Official ex-depot prices (PKR/litre) — OGRA & Ministry of Energy notifications Petrol (MS-92) Diesel (HSD) Pre-crisis baseline Source: OGRA / Ministry of Energy (Petroleum Division); Dawn.com · .fpw-root { --fpw-navy: #0a2240; --fpw-red: #b5341a; --fpw-grey: #888888; --fpw-border: #e0e0e0; --fpw-bg: #ffffff; --fpw-text: #1a1a1a; --fpw-muted: #666666; --fpw-insight-bg: #f0f4f8; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.4; color: var(--fpw-text); background: var(--fpw-bg); border: 1px solid var(--fpw-border); border-top: 3px solid var(--fpw-navy); padding: 16px 18px 14px; max-width: 720px; width: 100%; box-sizing: border-box; position: relative; } .fpw-root *, .fpw-root *::before, .fpw-root *::after { box-sizing: inherit; } .fpw-header { margin-bottom: 10px; } .fpw-title { font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-weight: 700; color: var(--fpw-navy); margin: 0 0 3px; } .fpw-sub { font-size: 11.5px; color: var(--fpw-muted); margin: 0; } .fpw-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; } .fpw-li { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--fpw-muted); } .fpw-dot { display: inline-block; width: 26px; height: 3px; border-radius: 2px; flex-shrink: 0; } .fpw-dot--navy { background: var(--fpw-navy); } .fpw-dot--red { background: var(--fpw-red); } .fpw-dot--grey { background: var(--fpw-grey); } .fpw-dot--dash { background: repeating-linear-gradient(to right, var(--fpw-red) 0 5px, transparent 5px 9px); } .fpw-dot--dotted { background: repeating-linear-gradient(to right, var(--fpw-grey) 0 4px, transparent 4px 8px); opacity:.7; } .fpw-wrap { position: relative; width: 100%; } .fpw-canvas { display: block; width: 100%; cursor: crosshair; } .fpw-tooltip { position: absolute; background: #fff; border: 1px solid #ddd; border-radius: 4px; padding: 7px 10px; font-size: 12px; color: var(--fpw-text); pointer-events: none; opacity: 0; transition: opacity 0.15s; box-shadow: 0 2px 8px rgba(0,0,0,0.10); white-space: nowrap; z-index: 10; line-height: 1.6; font-variant-numeric: tabular-nums; } .fpw-tooltip.fpw-tooltip--vis { opacity: 1; } .fpw-insight { margin-top: 10px; background: var(--fpw-insight-bg); border-left: 3px solid var(--fpw-navy); padding: 8px 12px; font-size: 12px; color: var(--fpw-navy); line-height: 1.5; transition: opacity 0.2s; } .fpw-insight--hidden { opacity: 0; pointer-events: none; } .fpw-footer { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--fpw-border); font-size: 10.5px; color: #999; line-height: 1.5; } @media (max-width: 480px) { .fpw-root { padding: 12px 12px 10px; } .fpw-title { font-size: 14px; } .fpw-legend { gap: 8px; } } (function () { /* ===================================================== DATA — EDIT HERE Shape: { d: 'DD Mon', p: petrol_Rs, h: diesel_Rs } Add daily: true for entries under the new daily mechanism. ===================================================== */ var DATA = [ { d: '28 Feb', p: 266.17, h: 280.86 }, { d: '7 Mar', p: 321.17, h: 335.86 }, { d: '3 Apr', p: 458.41, h: 520.35 }, { d: '5 Apr', p: 378.00, h: 440.35 }, { d: '11 Apr', p: 366.58, h: 385.54 }, { d: '25 Apr', p: 393.35, h: 393.35 }, { d: '1 May', p: 399.86, h: 399.58 }, { d: '9 May', p: 414.78, h: 414.58 }, { d: '16 May', p: 409.78, h: 409.58 }, { d: '23 May', p: 403.78, h: 402.78 }, { d: '30 May', p: 381.78, h: 380.78 }, { d: '6 Jun', p: 377.78, h: 380.78 }, { d: '13 Jun', p: 373.78, h: 378.78 }, { d: '19 Jun', p: 299.78, h: 311.78 }, { d: '26 Jun', p: 299.78, h: 311.56 }, { d: '4 Jul', p: 297.53, h: 309.50 }, { d: '11 Jul', p: 316.15, h: 323.30 }, { d: '18 Jul', p: 316.15, h: 354.35 }, { d: '21 Jul', p: 315.80, h: 367.58, daily: true }, { d: '22 Jul', p: 320.73, h: 367.21, daily: true }, { d: '23 Jul', p: 327.12, h: 375.04, daily: true }, { d: '24 Jul', p: 331.52, h: 378.66, daily: true }, { d: '25 Jul', p: 335.18, h: 383.46, daily: true }, { d: '26 Jul', p: 335.18, h: 383.46, daily: true }, { d: '27 Jul', p: 335.18, h: 383.46, daily: true }, { d: '28 Jul', p: 334.18, h: 386.83, daily: true }, { d: '29 Jul', p: 335.81, h: 388.38, daily: true }, { d: '30 Jul', p: 335.06, h: 390.62, daily: true }, { d: '31 Jul', p: 336.15, h: 393.04, daily: true }, { d: '1 Aug', p: 336.03, h: 392.38, daily: true }, { d: '2 Aug', p: 336.03, h: 392.38, daily: true }, { d: '3 Aug', p: 336.03, h: 392.38, daily: true }, { d: '4 Aug', p: 331.95, h: 389.93, daily: true }, { d: '5 Aug', p: 328.56, h: 385.86, daily: true }, { d: '6 Aug', p: 333.01, h: 383.86, daily: true }, { d: '7 Aug', p: 329.82, h: 382.36, daily: true }, { d: '8 Aug', p: 327.62, h: 380.86, daily: true }, { d: '9 Aug', p: 327.62, h: 380.86, daily: true }, { d: '10 Aug', p: 327.62, h: 380.86, daily: true }, { d: '11 Aug', p: 327.62, h: 380.86, daily: true }, { d: '12 Aug', p: 325.92, h: 382.25, daily: true }, { d: '13 Aug', p: 324.98, h: 382.79, daily: true }, { d: '14 Aug', p: 325.43, h: 383.95, daily: true }, { d: '15 Aug', p: 325.43, h: 383.95, daily: true }, { d: '16 Aug', p: 325.43, h: 383.95, daily: true }, { d: '17 Aug', p: 325.43, h: 383.95, daily: true }, { d: '18 Aug', p: 331.20, h: 390.42, daily: true }, { d: '19 Aug', p: 334.54, h: 395.69, daily: true }, { d: '20 Aug', p: 337.51, h: 363.06, daily: true }, { d: '21 Aug', p: 337.78, h: 364.70, daily: true }, { d: '22 Aug', p: 341.59, h: 368.29, daily: true }, { d: '23 Aug', p: 341.59, h: 368.29, daily: true }, { d: '24 Aug', p: 341.59, h: 368.29, daily: true }, { d: '25 Aug', p: 341.98, h: 370.69, daily: true }, { d: '26 Aug', p: 343.10, h: 371.80, daily: true }, { d: '27 Aug', p: 343.10, h: 371.80, daily: true }, { d: '28 Aug', p: 342.60, h: 371.61, daily: true }, { d: '29 Aug', p: 342.02, h: 371.44, daily: true }, { d: '30 Aug', p: 342.02, h: 371.44, daily: true }, { d: '31 Aug', p: 342.02, h: 371.44, daily: true }, { d: '1 Sep', p: 342.79, h: 370.41, daily: true }, { d: '2 Sep', p: 343.87, h: 370.92, daily: true }, { d: '3 Sep', p: 346.16, h: 372.03, daily: true }, { d: '4 Sep', p: 349, h: 374.31, daily: true }, { d: '5 Sep', p: 345.87, h: 378.05, daily: true }, { d: '6 Sep', p: 345.87, h: 378.05, daily: true }, { d: '7 Sep', p: 345.87, h: 378.05, daily: true }, { d: '8 Sep', p: 358.77, h: 381.77, daily: true }, { d: '9 Sep', p: 364.35, h: 385.95, daily: true }, { d: '10 Sep', p: 367.75, h: 392.67, daily: true }, { d: '11 Sep', p: 370.80, h: 398.04, daily: true }, { d: '12 Sep', p: 375.82, h: 403.32, daily: true }, { d: '13 Sep', p: 375.82, h: 403.32, daily: true }, { d: '14 Sep', p: 375.82, h: 403.32, daily: true }, { d: '15 Sep', p: 380.24, h: 409.42, daily: true }, { d: '16 Sep', p: 384.34, h: 415.83, daily: true }, { d: '17 Sep', p: 391.22, h: 421.45, daily: true }, { d: '18 Sep', p: 390.79, h: 424.92, daily: true }, { d: '19 Sep', p: 389.14, h: 424.04, daily: true }, { d: '20 Sep', p: 389.14, h: 424.04, daily: true }, { d: '21 Sep', p: 389.14, h: 424.04, daily: true }, { d: '22 Sep', p: 393.75, h: 422.08, daily: true }, { d: '23 Sep', p: 392.05, h: 418.96, daily: true }, { d: '24 Sep', p: 390.12, h: 414.75, daily: true }, { d: '25 Sep', p: 389.28, h: 412.12, daily: true }, { d: '26 Sep', p: 391.30, h: 408.53, daily: true }, { d: '27 Sep', p: 391.30, h: 408.53, daily: true }, { d: '28 Sep', p: 391.30, h: 408.53, daily: true }, { d: '29 Sep', p: 389.03, h: 404.97, daily: true }, { d: '30 Sep', p: 387.54, h: 402.24, daily: true }, { d: '1 Oct', p: 387.40, h: 400.35, daily: true }, { d: '2 Oct', p: 390.66, h: 399.34, daily: true }, { d: '3 Oct', p: 392.76, h: 399.64, daily: true }, { d: '6 Oct', p: 393.64, h: 397.76, daily: true }, { d: '7 Oct', p: 394.83, h: 395.85, daily: true }, { d: '8 Oct', p: 396.65, h: 394.94, daily: true }, { d: '9 Oct', p: 398.96, h: 395.72, daily: true }, { d: '10 Oct', p: 398.30, h: 396.24, daily: true }, { d: '13 Oct', p: 395.37, h: 396.85, daily: true }, { d: '14 Oct', p: 392.66, h: 396.82, daily: true }, { d: '15 Oct', p: 393.86, h: 396.65, daily: true }, { d: '16 Oct', p: 390.23, h: 396.96, daily: true }, { d: '17 Oct', p: 386.30, h: 396.96, daily: true }, { d: '20 Oct', p: 381.14, h: 389.27, daily: true }, { d: '21 Oct', p: 382.02, h: 389.80, daily: true }, { d: '22 Oct', p: 379.31, h: 390.11, daily: true }, ]; var PRE_PETROL = 266.17; var PRE_DIESEL = 280.86; var PEAK_IDX = 2; var CRISIS_START = 1; var CRISIS_END = 5; var DAILY_START = 19; var LAST_UPDATED = 'Oct 21, 2026'; var Y_MIN = 240; var Y_MAX = 550; var Y_STEP = 50; var C_NAVY = '#0a2240'; var C_RED = '#b5341a'; /* ---- root & elements ---- */ var scripts = document.querySelectorAll('script'); var thisScript = scripts[scripts.length - 1]; var root = thisScript.previousElementSibling; while (root && !root.classList.contains('fpw-root')) { root = root.previousElementSibling; } if (!root) root = document.querySelector('.fpw-root'); var canvas = root.querySelector('.fpw-canvas'); var tooltip = root.querySelector('.fpw-tooltip'); var insight = root.querySelector('.fpw-insight'); var insightText = root.querySelector('.fpw-insight-text'); var updatedEl = root.querySelector('.fpw-updated'); if (updatedEl) updatedEl.textContent = 'Last updated: ' + LAST_UPDATED; var ctx = canvas.getContext('2d'); var DPR = window.devicePixelRatio || 1; var PAD_L = 56, PAD_R = 18, PAD_T = 38, PAD_B = 54; var W, H, CW, CH; var points = []; function mapX(i) { return PAD_L + (i / (DATA.length - 1)) * CW; } function mapY(v) { return PAD_T + (1 - (v - Y_MIN) / (Y_MAX - Y_MIN)) * CH; } function dash(arr) { ctx.setLineDash(arr); } /* ---- draw ---- */ function draw(pct) { pct = pct === undefined ? 1 : pct; W = canvas.clientWidth || 600; H = Math.round(W * (W < 500 ? 0.82 : W < 640 ? 0.68 : 0.52)); CW = W - PAD_L - PAD_R; CH = H - PAD_T - PAD_B; canvas.width = W * DPR; canvas.height = H * DPR; canvas.style.height = H + 'px'; ctx.setTransform(DPR, 0, 0, DPR, 0, 0); ctx.clearRect(0, 0, W, H); var step = CW / (DATA.length - 1); /* crisis zone */ var zx0 = mapX(CRISIS_START) - step * 0.5; var zx1 = mapX(CRISIS_END) + step * 0.5; ctx.fillStyle = 'rgba(181,52,26,0.055)'; ctx.fillRect(zx0, PAD_T, zx1 - zx0, CH); ctx.strokeStyle = 'rgba(181,52,26,0.22)'; ctx.lineWidth = 1; dash([4, 3]); ctx.strokeRect(zx0, PAD_T, zx1 - zx0, CH); /* daily zone */ var dx0 = mapX(DAILY_START) - step * 0.5; dash([]); ctx.fillStyle = 'rgba(10,34,64,0.04)'; ctx.fillRect(dx0, PAD_T, W - PAD_R - dx0, CH); ctx.strokeStyle = 'rgba(10,34,64,0.18)'; ctx.lineWidth = 1; dash([3, 3]); ctx.beginPath(); ctx.moveTo(dx0, PAD_T); ctx.lineTo(dx0, PAD_T + CH); ctx.stroke(); dash([]); /* Y grid + labels */ ctx.textAlign = 'right'; ctx.textBaseline = 'middle'; var fs = W < 440 ? 9 : 10; ctx.font = fs + 'px Arial,sans-serif'; for (var yv = Y_MIN + Y_STEP; yv 400) { ctx.fillText('Daily pricing', dx0 + 5, PAD_T + 4); } else { ctx.fillText('Daily', dx0 + 4, PAD_T + 4); } /* clip for animation */ var clipX = PAD_L + CW * pct; /* diesel line */ ctx.save(); ctx.beginPath(); ctx.rect(PAD_L, 0, clipX - PAD_L, H); ctx.clip(); ctx.strokeStyle = C_RED; ctx.lineWidth = 2.2; dash([5, 4]); ctx.beginPath(); DATA.forEach(function (d, i) { var x = mapX(i), y = mapY(d.h); i === 0 ? ctx.moveTo(x, y) : ctx.lineTo(x, y); }); ctx.stroke(); dash([]); ctx.restore(); /* petrol line */ ctx.save(); ctx.beginPath(); ctx.rect(PAD_L, 0, clipX - PAD_L, H); ctx.clip(); ctx.strokeStyle = C_NAVY; ctx.lineWidth = 2.2; ctx.beginPath(); DATA.forEach(function (d, i) { var x = mapX(i), y = mapY(d.p); i === 0 ? ctx.moveTo(x, y) : ctx.lineTo(x, y); }); ctx.stroke(); ctx.restore(); /* dots */ points = []; DATA.forEach(function (d, i) { var x = mapX(i); if (x > clipX + 2) return; var yp = mapY(d.p), yh = mapY(d.h); points[i] = { x: x, yp: yp, yh: yh }; dot(x, yp, C_NAVY); dot(x, yh, C_RED); }); /* X labels — evenly spaced (equal pixel gaps) by array index. Starts at a weekly step (every 7th point); if that would still crowd labels at the current width, widens to bi-weekly (14), tri-weekly (21), etc. until labels fit with a comfortable gap. */ ctx.textAlign = 'right'; ctx.textBaseline = 'top'; ctx.fillStyle = '#888'; var xfs = W < 440 ? 8 : (W < 580 ? 9 : 10); ctx.font = xfs + 'px Arial,sans-serif'; var maxLabelW = 0; DATA.forEach(function (d) { maxLabelW = Math.max(maxLabelW, ctx.measureText(d.d).width); }); /* rotated -45deg footprint, plus a small gap between labels */ var neededPx = maxLabelW * 0.7071 + xfs * 0.7071 + 6; var pxPerIndex = CW / (DATA.length - 1); var labelStep = 7; while (pxPerIndex * labelStep < neededPx && labelStep < DATA.length) { labelStep += 7; } DATA.forEach(function (d, i) { var isLast = i === DATA.length - 1; if (i % labelStep !== 0 && !isLast) return; ctx.save(); ctx.translate(mapX(i), PAD_T + CH + 6); ctx.rotate(-Math.PI / 4); ctx.fillText(d.d, 0, 0); ctx.restore(); }); } function dot(x, y, color) { ctx.beginPath(); ctx.arc(x, y, 3.5, 0, Math.PI * 2); ctx.fillStyle = '#fff'; ctx.fill(); ctx.strokeStyle = color; ctx.lineWidth = 2; ctx.stroke(); } /* ---- animate on scroll ---- */ var animated = false; var reduced = window.matchMedia('(prefers-reduced-motion: reduce)').matches; function animateDraw() { if (reduced) { draw(1); return; } var t0 = null, dur = 900; function frame(ts) { if (!t0) t0 = ts; var p = Math.min(1, (ts - t0) / dur); draw(1 - Math.pow(1 - p, 3)); if (p < 1) requestAnimationFrame(frame); } requestAnimationFrame(frame); } if ('IntersectionObserver' in window) { var io = new IntersectionObserver(function (entries) { if (entries[0].isIntersecting && !animated) { animated = true; animateDraw(); io.unobserve(canvas); } }, { threshold: 0.3 }); io.observe(canvas); } else { draw(1); } /* ---- tooltip ---- */ function nearest(cx) { var rect = canvas.getBoundingClientRect(); var mx = (cx - rect.left) * (W / rect.width); var best = -1, bd = Infinity; points.forEach(function (pt, i) { if (!pt) return; var d = Math.abs(pt.x - mx); if (d < bd) { bd = d; best = i; } }); return best; } function showTip(cx) { var i = nearest(cx); if (i < 0) return; var d = DATA[i], pt = points[i]; if (!pt) return; var rect = canvas.getBoundingClientRect(); var scaleX = rect.width / W; var scaleY = rect.height / H; var tx = pt.x * scaleX - 8; var ty = Math.min(pt.yp, pt.yh) * scaleY - 6; if (tx + 180 > rect.width) tx -= 160; if (ty < 0) ty = 4; tooltip.style.left = tx + 'px'; tooltip.style.top = ty + 'px'; tooltip.innerHTML = '' + d.d + (d.daily ? ' (daily)' : '') + '' + '● Petrol Rs ' + d.p.toFixed(2) + '' + '● Diesel Rs ' + d.h.toFixed(2); tooltip.classList.add('fpw-tooltip--vis'); var pct = ((d.p - PRE_PETROL) / PRE_PETROL * 100).toFixed(1); var sign = pct >= 0 ? '+' : ''; var msg; if (i === 0) { msg = 'The pre-crisis price — petrol at Rs' + PRE_PETROL + ' and diesel at Rs' + PRE_DIESEL + ' per litre. This is the baseline before the US-Iran war broke out on 28 Feb 2026.'; } else if (i === PEAK_IDX) { msg = 'All-time record — petrol was ' + sign + pct + '% above its pre-crisis level of Rs' + PRE_PETROL + '. Diesel hit Rs' + d.h.toFixed(2) + ' vs Rs' + PRE_DIESEL + ' before the crisis.'; } else if (d.p < PRE_PETROL) { msg = 'Petrol dipped at or below the pre-crisis price of Rs' + PRE_PETROL + ' — one of the few times it reached that level.'; } else { msg = 'Petrol was ' + sign + pct + '% above the pre-crisis level on this date' + (d.daily ? ', under the new OGRA daily pricing mechanism.' : '.'); } insightText.textContent = msg; insight.classList.remove('fpw-insight--hidden'); } function hideTip() { tooltip.classList.remove('fpw-tooltip--vis'); } canvas.addEventListener('mousemove', function (e) { showTip(e.clientX); }); canvas.addEventListener('mouseleave', hideTip); canvas.addEventListener('touchstart', function (e) { e.preventDefault(); showTip(e.touches[0].clientX); }, { passive: false }); canvas.addEventListener('touchend', function () { setTimeout(hideTip, 2200); }); /* ---- resize ---- */ var rtimer; window.addEventListener('resize', function () { clearTimeout(rtimer); rtimer = setTimeout(function () { draw(1); }, 130); }); draw(1); })(); (function() { var scripts = document.getElementsByTagName('script'); var currentScript = document.currentScript || scripts[scripts.length - 1]; var wrapper = currentScript; while (wrapper && (!wrapper.classList || !wrapper.classList.contains('raw-html-embed-wrapper'))) { wrapper = wrapper.parentNode; } if (!wrapper || wrapper._rawHtmlMounted) return; wrapper._rawHtmlMounted = true; var host = wrapper.querySelector('.raw-html-host'); var sourceEl = wrapper.querySelector('script.raw-html-source'); if (!host || !sourceEl) return; // 1. Upgrade ancestor overflow:hidden / overflow-x:hidden to clip so native position:sticky works var anc = wrapper; while (anc && anc !== document) { if (anc.nodeType === 1) { var cs = window.getComputedStyle(anc); if (cs.overflow === 'hidden') { anc.style.overflow = 'clip'; } else { if (cs.overflowX === 'hidden') anc.style.overflowX = 'clip'; if (cs.overflowY === 'hidden') anc.style.overflowY = 'clip'; } } anc = anc.parentNode; } // 2. Parse the raw HTML using the browser's native C++ DOMParser (inert: scripts don't run, images don't decode yet) var rawHtml = sourceEl.textContent.replace(/4KB) into binary Blob URLs to prevent iOS Safari Jetsam crashes function b64ToBlobUrl(dataUri) { try { var comma = dataUri.indexOf(','); if (comma === -1) return dataUri; var mime = (dataUri.slice(5, comma).split(';')[0]) || 'image/webp'; var raw = atob(dataUri.slice(comma + 1)); var len = raw.length; var bytes = new Uint8Array(len); for (var i = 0; i < len; i++) { bytes[i] = raw.charCodeAt(i); } return URL.createObjectURL(new Blob([bytes], { type: mime })); } catch (e) { return dataUri; } } function optimizeImages(root) { if (!root || !root.querySelectorAll) return; var imgs = root.querySelectorAll('img[src^="data:image/"], image[href^="data:image/"]'); for (var i = 0; i < imgs.length; i++) { var el = imgs[i]; var attr = el.hasAttribute('src') ? 'src' : 'href'; var val = el.getAttribute(attr); if (val && val.length > 4096) { el.setAttribute(attr, b64ToBlobUrl(val)); } if (el.tagName === 'IMG' && !el.hasAttribute('decoding')) { el.setAttribute('decoding', 'async'); } } var tpls = root.querySelectorAll('template'); for (var j = 0; j < tpls.length; j++) { optimizeImages(tpls[j].content); } var allEls = root.querySelectorAll('*'); for (var k = 0; k < allEls.length; k++) { if (allEls[k].shadowRoot) { optimizeImages(allEls[k].shadowRoot); } } } optimizeImages(parsedDoc); // 4. Extract executable tags before mounting so they don't run against global document // We replace each inline script in the DOM with a dummy marker so that DOM traversal // patterns like `document.querySelectorAll('script')` and `script.previousElementSibling` // remain intact when the scripts execute. var executableScripts = []; var allScripts = Array.prototype.slice.call(parsedDoc.querySelectorAll('script')); for (var i = 0; i < allScripts.length; i++) { var s = allScripts[i]; var type = (s.getAttribute('type') || '').trim().toLowerCase(); if (!type || type === 'text/javascript' || type === 'application/javascript' || type === 'module') { executableScripts.push(s); var marker = parsedDoc.createElement('script'); if (s.id) marker.id = s.id; marker.type = 'text/plain'; marker.className = 'raw-html-script-marker'; marker.dataset.scriptIndex = String(executableScripts.length - 1); s.parentNode.replaceChild(marker, s); s._domMarker = marker; } } // 5. Promote to parent document.head so @font-face declarations load var links = parsedDoc.querySelectorAll('link[rel="stylesheet"]'); for (var l = 0; l < links.length; l++) { var href = links[l].getAttribute('href'); if (href && !document.head.querySelector('link[href="' + href.replace(/"/g, '\\"') + '"]')) { document.head.appendChild(links[l].cloneNode(true)); } } // 6. Adapt :root -> :host, html and overflow-x:hidden -> overflow-x:clip in tags var styles = parsedDoc.querySelectorAll('style'); for (var stIdx = 0; stIdx < styles.length; stIdx++) { styles[stIdx].textContent = styles[stIdx].textContent .replace(/:root\b/g, ':host, html') .replace(/overflow-x\s*:\s*hidden/gi, 'overflow-x:clip'); } // 7. Mount the real ...... tree into the Shadow Root var shadow = host.attachShadow({ mode: 'open' }); var resetStyle = document.createElement('style'); resetStyle.textContent = ':host { all: initial; display: block; width: 100%; isolation: isolate; font-family: system-ui, -apple-system, sans-serif; color: #111; box-sizing: border-box; } html, body { display: block; margin: 0; padding: 0; width: 100%; box-sizing: border-box; } head, title, meta { display: none; }'; shadow.appendChild(resetStyle); var shadowHtml = parsedDoc.documentElement; var shadowHead = parsedDoc.head; var shadowBody = parsedDoc.body; shadow.appendChild(shadowHtml); // 8. Smooth scroll for internal #hash anchor clicks inside Shadow DOM shadow.addEventListener('click', function(e) { var a = e.target && e.target.closest ? e.target.closest('a[href^="#"]') : null; if (!a) return; var hash = a.getAttribute('href'); if (!hash || hash === '#') return; var id = decodeURIComponent(hash.slice(1)); var target = shadow.getElementById(id) || shadow.querySelector(hash); if (target) { e.preventDefault(); target.scrollIntoView({ behavior: 'smooth', block: 'start' }); } }); // 9. Lightweight document Proxy that routes DOM queries to the Shadow Root // while leaving window and all native JS constructors 100% untouched. var activeScript = null; var shadowDocument = new Proxy(document, { get: function(target, prop) { if (prop === 'getElementById') { return function(id) { return shadow.getElementById(id); }; } if (prop === 'querySelector') { return function(sel) { return shadow.querySelector(sel); }; } if (prop === 'querySelectorAll') { return function(sel) { return shadow.querySelectorAll(sel); }; } if (prop === 'getElementsByClassName') { return function(cls) { return shadowHtml.getElementsByClassName(cls); }; } if (prop === 'getElementsByTagName') { return function(tag) { var t = String(tag).toLowerCase(); if (t === 'html') return [shadowHtml]; if (t === 'head') return [shadowHead]; if (t === 'body') return [shadowBody]; return shadowHtml.getElementsByTagName(tag); }; } if (prop === 'documentElement') return shadowHtml; if (prop === 'head') return shadowHead; if (prop === 'body') return shadowBody; if (prop === 'currentScript') return (activeScript && activeScript._domMarker) || activeScript; if (prop === 'addEventListener') { return function(type, listener, options) { if (type === 'DOMContentLoaded' && document.readyState !== 'loading') { setTimeout(function() { listener.call(shadowDocument, new Event('DOMContentLoaded')); }, 0); return; } return document.addEventListener(type, listener, options); }; } var val = target[prop]; return typeof val === 'function' ? val.bind(target) : val; } }); // 10. Execute scripts sequentially function runNextScript(idx) { if (idx >= executableScripts.length) { // Free inert and payloads after initialization var cleanup = shadow.querySelectorAll('template, script[type="text/plain"]'); for (var c = 0; c < cleanup.length; c++) { cleanup[c].remove(); } optimizeImages(shadow); return; } var s = executableScripts[idx]; activeScript = s; var src = s.getAttribute('src'); if (src) { var ext = document.createElement('script'); ext.src = src; ext.async = false; ext.onload = ext.onerror = function() { runNextScript(idx + 1); }; shadowHead.appendChild(ext); return; } try { var fn = new Function('document', s.textContent); fn.call(window, shadowDocument); } catch (err) { console.error('RawHtml script error:', err); } runNextScript(idx + 1); } runNextScript(0); })(); The government on Wednesday decreased the price of petrol by Rs2.71 per litre, but raised that of high-speed diesel (HSD) by Re0.31. Following the revision, petrol will retail at Rs379.31 per litre while HSD will cost Rs390.11 per litre. The government continues to levy Rs114 per litre in taxes and duties on petrol and Rs100 per litre on diesel. According to the Petroleum Division’s notification, the new prices are applicable for Oct 22 (Thursday). The price of HSD has come down from a peak of Rs520.35 recorded on April 3. Its price had started rising from Rs281 per litre after the US-Iran war broke out on February 28. The petrol price had peaked at Rs458.41 on April 3 after beginning its upward trajectory from Rs266 in the first week of March. Meanwhile, the government has reintroduced a raft of austerity measures in response to rising fuel prices amid the ongoing Middle East conflict. Under these measures, markets are required to close by 9pm and fuel allocations for official vehicles has been cut by 50 per cent for three months. On September 13, Prime Minister Shehbaz Sharif also announced a “relief scheme” for users of motorcycles, autos and vehicles of up to 800cc to “alleviate the burden” of rising global oil prices. Previously, on July 17, Petroleum Minister Ali Pervaiz Malik announced that fuel prices would now be fixed on a daily basis due to fluctuations in international market prices following renewed hostilities between Iran and the US. Prior to this, the government had been announcing weekly revisions to fuel prices since early March, alongside measures for the conservation of fuel amid possible oil supply disruptions due to the ongoing conflict in the Middle East. The federal government in April also announced targeted relief measures to provide subsidised fuel. The petroleum minister stated that the cabinet and the prime minister had decided to give the Oil and Gas Regulatory Authority (Ogra) the responsibility of deciding fuel prices on a daily basis based on international market trends. Petrol is mainly used in private transport, small vehicles, rickshaws and two-wheelers, and changes in its price affect the middle and lower-middle classes. Similarly, changes in diesel prices also impact the public at large, as it is mainly used in the heavy transport sector, power plants and large generators. Petrol and high-speed diesel (HSD) are the major revenue earners, with monthly sales of about 700,000 to 800,000 tonnes, compared to just 10,000 tonnes of monthly demand for kerosene.
Comment