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

Some browsers that don't support Dart download the Dart source anyway #8372

Closed
justinfagnani opened this issue Feb 6, 2013 · 9 comments
Closed
Labels
area-library library-html P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@justinfagnani
Copy link
Contributor

User report from a thread on misc:
https://groups.google.com/a/dartlang.org/forum/?fromgroups=#!topic/misc/_1CeXH3vkXg

There are bugs for Firefox and Opera, but we might want to handle this. Server-side script selection would help, as would using a data-src attribute and letting dart.js fix it up when it starts the VM.

@DartBot
Copy link

DartBot commented Feb 14, 2013

This comment was originally written by googlegroups...@kaioa.com


Opera announced the switch to Webkit/V8 today. I consider it solved.

IE9 and IE10 are affected. I have no idea how to submit IE bug reports to Microsoft. Would be nice if someone could do that for me.

Safari 6 isn't affected.

@DartBot
Copy link

DartBot commented Mar 3, 2013

This comment was originally written by googlegroups...@kaioa.com


It gets worse. There are proxies which inline external resources such as CSS or JS files. The one used by Vodafone in Germany ignores the type attribute. It embeds the content and removes the src attribute. Unfortunately, dart.js needs that src attribute to construct the path to the JS file.

Basically, this line:

    <script type="application/dart" src="example.dart"></script>

Becomes:

    <script type="application/dart" style="display:none">
    <!--
    [contents of example.dart]
    -->
    </script>

And now dart.js won't be able to figure out that the name of the JS file is "example.dart.js".

@DartBot
Copy link

DartBot commented Mar 6, 2013

This comment was originally written by googlegroups...@kaioa.com


This is the bootstrap code (as rendered into the document) I currently use as workaround:

    <script>
    (function () {
        var g = document.createElement('script'), s;
        g.async = true;
        g.src = 'example.dart';
        if (navigator.webkitStartDart && navigator.webkitStartDart())
            g.type = 'application/dart';
        else
            g.src += '.js';
        g.src += '?123';
        s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(g, s);
    }());
    </script>

The injection part works like GA's. So, that part should be pretty solid.

My bootstrap code doesn't handle any of dart.js' other functions though.

@efortuna
Copy link
Contributor

Added this to the Later milestone.

@kevmoo
Copy link
Member

kevmoo commented Apr 7, 2014

Removed Area-HTML label.
Added Area-Library, Library-Html labels.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@alan-knight
Copy link
Contributor

This seems to be still the case. Maybe a transformer would be useful?

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed triaged labels Feb 29, 2016
@dgrove
Copy link
Contributor

dgrove commented Apr 25, 2018

With Dartium gone, obsolete.

@dgrove dgrove closed this as completed Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-library library-html P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

7 participants