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

Cross browser devtools #165

Closed
wants to merge 2 commits into from

Conversation

o0101
Copy link

@o0101 o0101 commented Sep 12, 2021

I'm sorry this will probably be the stupidest PR you see this year, but I want the wonderful devtools-frontend to be able to work in Firefox and Safari. Currently it does not.

There may be lots of work to get this ready, and I'm sure this will seem like a highly stupid, useless and unimportant change to implement for the Chrome team because this is Chrome devtools-frontend afterall.

This PR tracks work regarding that.

The first change involved adding a polyfill for constructible stylesheets as new CSSStyleSheet does not work in Firefox or Safari. It may be possible to revert this polyfill addition in future, as Firefox might be implementing this API.

devtools-frontend uses constructible stylesheets and they appear in the generated CSS JavaScript files. The following is an example, the first few lines of devtools/Images/Images.js:

// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const sheet = new CSSStyleSheet();
sheet.replaceSync(':root {}');
const style = sheet.cssRules[0].style;

style.setProperty('--image-file-accelerometer-bottom', 'url(' + new URL('./accelerometer-bottom.png', import.meta.url).toString() + ')');

These are the types of non-cross-browsers APIs that are currently blocking devtools-frontend from working cross-browser.

I'm sure you folks are incredibly busy as well, so I totally get if you're too busy to look at this or if anything else makes it impossible for you, and no worries at all, just thanks for reading this far!

@bmeurer
Copy link
Contributor

bmeurer commented Sep 13, 2021

Thanks for the PR. Generally I'm not opposed to having support for browsers other than Chromium, however our team will not be able to actively maintain that support and ensure that things are still working, so some kind of commitment needs to be there first on your end.

Also we don't use GitHub for issue tracking and code review, so please file a tracking bug on crbug.com and submit code changes via Gerrit. The README has all the relevant pointers and information.

@o0101
Copy link
Author

o0101 commented Sep 13, 2021

Thank you @bmeurer for the invitation, I'll consider if I can make this commitment, and follow the process you describe if I can!

@o0101 o0101 closed this Sep 13, 2021
@o0101
Copy link
Author

o0101 commented Feb 3, 2022

Hey @bmeurer, hope you're well and thanks again for the invitation. I've considered this and decided that I can commit to actively maintain that support and ensure that things are still working. I've just cloned depot_tools and fetched devtools-frontend, and updated to latest. I'll open a tracking bug on crbug, and submit code changes to Gerrit. I have no idea what I'm doing with any of this, and this devtools workflow is almost completely new to me so it will take me some time to set up. I'll follow the README, but I'm sorry I may need to reach out to you or someone else if I get stuck on something. I apologize in advance for any trouble this causes you.

Serendipitously, it's now 144 days / 3,456 hours since this PR, and I think it's an time for me to do some work on it. Thank you again, have a good one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants