Skip to content

Instantly share code, notes, and snippets.

View opichals's full-sized avatar

Standa Opichal opichals

  • Prague, Czech Republic
View GitHub Profile
@opichals
opichals / 0README.md
Created August 31, 2020 20:43 — forked from artizirk/0README.md
Apple macOS Catalina under Linux KVM with GVT-g Intel GPU passthrough notes
@opichals
opichals / background.js
Created June 21, 2019 16:24 — forked from josephrocca/background.js
Chrome extension to force-enable CORS based on request's *source* url (i.e. the url of the browser tab) rather than the target url
// Notes: we need the `sourceTabUrl &&` before the URL check because chromebooks make weird requests that don't come from "real" tabs.
let accessHeaders = new Map();
let tabIdToUrlMap = new Map();
let requestListener = function (details) {
const accessControlRequestHeader = details.requestHeaders.find(elem => elem.name.toLowerCase() === "access-control-request-headers");
if(accessControlRequestHeader) {
accessHeaders.set(details.requestId, accessControlRequestHeader.value);
}