Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin loading breaks when resistFingerprinting is enabled #7173

Closed
Luzifer opened this issue Feb 18, 2020 · 2 comments · Fixed by #7175
Closed

Plugin loading breaks when resistFingerprinting is enabled #7173

Luzifer opened this issue Feb 18, 2020 · 2 comments · Fixed by #7175
Labels
browser/firefox issues related to the firefox browser plug-in system issues related to the plug-in system

Comments

@Luzifer
Copy link
Contributor

Luzifer commented Feb 18, 2020

Description

When Firefox is hardened against fingerprinting by enabling privacy.resistFingerprinting loading of plugins breaks with an error to the console. This for example breaks language-support-plugins.

Reproduction Steps

  • Fetch theiaide/theia:next docker image and start it (:latest shows same behavior)
  • Get a recent Firefox
  • Access about:config and enable privacy.resistFingerprinting
  • Try to load the application
  • See error:
root ERROR Failed to load plugins: U</e.prototype.createMeasurement/<@https://***HOST***/bundle.js:8:376112
U</e.prototype.logMeasurement@https://***HOST***/bundle.js:8:376368
U</e.prototype.syncPlugins/</<@https://***HOST***/bundle.js:8:366859
s/</<@https://***HOST***/bundle.js:8:360880
s/<@https://***HOST***/bundle.js:8:360985
a@https://***HOST***/bundle.js:8:359728

OS and Theia version:

  • Theia: @theia/core 0.16.0-next.00c1747c
  • OS: Archlinux, Firefox 73.0

Diagnostics:

  • Firefox Bug 1369303
  • Firefox Bug 1511941 (Possible fix)
  • Relevant code:
    protected createMeasurement(name: string): () => number {
    const startMarker = `${name}-start`;
    const endMarker = `${name}-end`;
    performance.clearMeasures(name);
    performance.clearMarks(startMarker);
    performance.clearMarks(endMarker);
    performance.mark(startMarker);
    return () => {
    performance.mark(endMarker);
    performance.measure(name, startMarker, endMarker);
    const duration = performance.getEntriesByName(name)[0].duration;
    performance.clearMeasures(name);
    performance.clearMarks(startMarker);
    performance.clearMarks(endMarker);
    return duration;
    };
    }
  • Failing code:
    const duration = performance.getEntriesByName(name)[0].duration;

Example (tested in dev-console):

21:27:49.736 performance.mark('foo-start')
21:27:49.756 undefined
21:28:08.117 performance.mark('foo-end')
21:28:08.178 undefined
21:28:32.134 performance.measure('foo-name', 'foo-start', 'foo-end')
21:28:32.152 undefined
21:28:42.935 performance.getEntriesByName('foo-name')
21:28:42.982 Array []
21:28:46.752 performance.getEntriesByName('foo-name')[0]
21:28:46.763 undefined
21:28:51.444 performance.getEntriesByName('foo-name')[0].duration
21:28:51.487 TypeError: performance.getEntriesByName(...)[0] is undefined

refs / obsoletes theia-ide/theia-apps#306

@vince-fugnitto vince-fugnitto added browser/firefox issues related to the firefox browser plug-in system issues related to the plug-in system labels Feb 18, 2020
@akosyakov
Copy link
Member

akosyakov commented Feb 19, 2020

I wonder what their recommendation to use instead of performance API in such case. As far as I know that it is the standardised API and expected to work in all browsers.

@Luzifer
Copy link
Contributor Author

Luzifer commented Feb 19, 2020

@akosyakov the API itself works. It just does not return performance data. While in core there is an iteration through the returned array which in that case would be an iteration over Array[] in this code the first element is just accessed.

Firefox does not return any elements when resistFingerprinting is enabled and therefore a length check is required in before accessing the duration of the first element.

akosyakov pushed a commit that referenced this issue Feb 19, 2020
Signed-off-by: Knut Ahlers <knut@ahlers.me>
JesterOrNot pushed a commit to JesterOrNot/theia that referenced this issue Mar 12, 2020
Signed-off-by: Knut Ahlers <knut@ahlers.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser/firefox issues related to the firefox browser plug-in system issues related to the plug-in system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants