question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MPR not working on OHIF v3 ("Your page is NOT cross-origin isolated" in console)

See original GitHub issue

On the latest version of OHIF V3 MPR is not working for me.This exact setup works fine with OHIF v2. Im running OHIF in Nginx v1.23.2. Im posting my Nginx config file, OHIF app-config.js contents files below:

Screenshot 2022-11-22 181350

What steps can we follow to reproduce the bug?

  1. Open study from study browser
  2. Click MPR toolbar button

app-config.js

window.config = {
    routerBasename: "/",
    extensions: [],
    modes: [],
    showStudyList: !0,
    maxNumberOfWebWorkers: 4,
    omitQuotationForMultipartRequest: !0,
    showLoadingIndicator: !0,
    maxNumRequests: {
        interaction: 100,
        thumbnail: 75,
        prefetch: 10
    },
    dataSources: [{
        friendlyName: "dcmjs DICOMWeb Server",
        namespace: "@ohif/extension-default.dataSourcesModule.dicomweb",
        sourceName: "dicomweb",
        configuration: {
            name: 'Orthanc',
	    wadoUriRoot: '/orthanc/wado',
	    qidoRoot: '/orthanc/dicom-web',
	    wadoRoot: '/orthanc/dicom-web',
            qidoSupportsIncludeField: !1,
            imageRendering: "wadors",
            thumbnailRendering: "wadors",
            enableStudyLazyLoad: !0,
            supportsFuzzyMatching: !1,
        }
    }, {
        friendlyName: "dicom json",
        namespace: "@ohif/extension-default.dataSourcesModule.dicomjson",
        sourceName: "dicomjson",
        configuration: {
            name: "json"
        }
    }, {
        friendlyName: "dicom local",
        namespace: "@ohif/extension-default.dataSourcesModule.dicomlocal",
        sourceName: "dicomlocal",
        configuration: {}
    }],
    httpErrorHandler: e => {
        console.warn(e.status), console.warn("test, navigate to https://ohif.org/")
    },
    defaultDataSourceName: "dicomweb",
    hotkeys: [{
        commandName: "incrementActiveViewport",
        label: "Next Viewport",
        keys: ["right"]
    }, {
        commandName: "decrementActiveViewport",
        label: "Previous Viewport",
        keys: ["left"]
    }, {
        commandName: "rotateViewportCW",
        label: "Rotate Right",
        keys: ["r"]
    }, {
        commandName: "rotateViewportCCW",
        label: "Rotate Left",
        keys: ["l"]
    }, {
        commandName: "invertViewport",
        label: "Invert",
        keys: ["i"]
    }, {
        commandName: "flipViewportHorizontal",
        label: "Flip Horizontally",
        keys: ["h"]
    }, {
        commandName: "flipViewportVertical",
        label: "Flip Vertically",
        keys: ["v"]
    }, {
        commandName: "scaleUpViewport",
        label: "Zoom In",
        keys: ["+"]
    }, {
        commandName: "scaleDownViewport",
        label: "Zoom Out",
        keys: ["-"]
    }, {
        commandName: "fitViewportToWindow",
        label: "Zoom to Fit",
        keys: ["="]
    }, {
        commandName: "resetViewport",
        label: "Reset",
        keys: ["space"]
    }, {
        commandName: "nextImage",
        label: "Next Image",
        keys: ["down"]
    }, {
        commandName: "previousImage",
        label: "Previous Image",
        keys: ["up"]
    }, {
        commandName: "setToolActive",
        commandOptions: {
            toolName: "Zoom"
        },
        label: "Zoom",
        keys: ["z"]
    }, {
        commandName: "windowLevelPreset1",
        label: "W/L Preset 1",
        keys: ["1"]
    }, {
        commandName: "windowLevelPreset2",
        label: "W/L Preset 2",
        keys: ["2"]
    }, {
        commandName: "windowLevelPreset3",
        label: "W/L Preset 3",
        keys: ["3"]
    }, {
        commandName: "windowLevelPreset4",
        label: "W/L Preset 4",
        keys: ["4"]
    }, {
        commandName: "windowLevelPreset5",
        label: "W/L Preset 5",
        keys: ["5"]
    }, {
        commandName: "windowLevelPreset6",
        label: "W/L Preset 6",
        keys: ["6"]
    }, {
        commandName: "windowLevelPreset7",
        label: "W/L Preset 7",
        keys: ["7"]
    }, {
        commandName: "windowLevelPreset8",
        label: "W/L Preset 8",
        keys: ["8"]
    }, {
        commandName: "windowLevelPreset9",
        label: "W/L Preset 9",
        keys: ["9"]
    }]
};

nginx.conf

worker_processes  1;

events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    #gzip  on;

    server    {
       
        listen 8099;
        server_name default_server;
       
		location / {
			try_files $uri $uri/ /index.html;
				  }
				  
        location /orthanc/{
            access_log  logs/access.log;
            proxy_pass http://localhost:8042;
            proxy_set_header HOST $Host:8099/orthanc/;
            proxy_set_header X-Real-IP $remote_addr;

            rewrite /orthanc(.*) $1 break;

            add_header 'Access-Control-Allow-Credentials' 'true';
            add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Allow-Origin' '*';

        }
       
    }

}

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:15

github_iconTop GitHub Comments

2reactions
ranasrulecommented, Nov 25, 2022

Hi! Yesterday I ran into the same issue. After adding the COEP and the COOP headers, it fixed the problem in Firefox, but Chromium (Version 107.0.5304.110) kept complaining that the workers were still missing headers. After reading a bit on the topic on this page, I realised that workers served with COEP set at require-corp needs to have a Cross-Origin-Resource-Policy explicitly set too. You might want to try adding the following header too:

Cross-Origin-Resource-Policy: same-origin

For me it fixed the issue of the workers in Chrome. Hope that helps!

this seems to have fixed it…thanks

2reactions
Gabshacommented, Nov 24, 2022

Hi! Yesterday I ran into the same issue. After adding the COEP and the COOP headers, it fixed the problem in Firefox, but Chromium (Version 107.0.5304.110) kept complaining that the workers were still missing headers. After reading a bit on the topic on this page, I realised that workers served with COEP set at require-corp needs to have a Cross-Origin-Resource-Policy explicitly set too. You might want to try adding the following header too:

Cross-Origin-Resource-Policy: same-origin

For me it fixed the issue of the workers in Chrome. Hope that helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

MPR not working on OHIF v3 ("Your page is NOT cross-origin ...
On the latest version of OHIF V3 MPR is not working for me.This exact setup works fine with OHIF v2. Im running OHIF...
Read more >
OHIF v3 not working if served from non root folder #2769
Hi there, I'm trying to build OHIF v3, i'm taking the source code from v3-stable branch, When i follow the build instruction yarn...
Read more >
A guide to enable cross-origin isolation - web.dev
Cross-origin isolation enables a web page to use powerful features such as SharedArrayBuffer. This article explains how to enable ...
Read more >
DicomWeb CORS Error Loading Image in OHIF - Google Groups
This works as expected and stores the instances in S3. The problem occurs when I attempt to integrate the OHIF Viewer with this...
Read more >
Enable and debug cross-origin isolated - YouTube
To mitigate the risk of side-channel attacks, browsers offer an opt-in-based isolated environment called cross-origin isolated.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found