Dart server works in Chrome and Firefox, but not in Dartium - dart

I’m new to Dart and I’m going through the server tutorial (https://dart-lang.github.io/server/codelab/). For some reason, the final application is working fine when accessed from the Chrome browser (Windows, Version 57.0.2987.133 (64-bit)) and Firefox (47.0.2), but not in Dartium (=Chromium, Version 45.0.2454.104). When requested from Dartium, the server provides the html page, but it is static. The Dart code behind it (e.g. web/piratebadge.dart) doesn’t seem to execute at all.
However, if I run a simple client-based application (like https://webdev.dartlang.org/codelabs/angular_components) and serve it using pub serve, it works fine both in Dartium and in Chrome.
Any ideas what might be wrong?

Related

Can Webapp work exactly same as a desktop app using electron?

if I build an angular app and feed run it using electron, will it work exactly like a web-application ?
Short answer: yes it does work exactly like web-application.
Electron is chromium browser, and nodejs bundled together. Every app that is made for chrome would seamlessly work in electron, and would work exactly like a web app.

Rails app on heroku: blank pages on a specific computer

I have a fairly vanilla Rails application on heroku that works fine ... except on my Dad's computer. It is Windows 7, and the site always shows as a blank page. I have checked the following:
Both Chrome, Firefox and IE (latest versions) all exhibit the problem. Web inspector on Chrome and FF shows either a 200 or 304 response code, but blank body.
I have tried clearing the cache.
Curl on his machine successfully downloads the page.
My laptop on his network views the page fine.
His laptop on other networks still exhibits the problem.
His other laptop works fine.
Multiple other machines (5+) work fine.
Server logs show a successful response being served.
Turned off Microsoft Security Essentials.
Turned off the firewall.
I'm stumped. What other debugging steps should I try?
For reference, the site is http://gccc.herokuapp.com/
Solution from twitter: https://www.malwarebytes.org/ picked up a couple of Trojans that were causing issues. I had assumed "Microsoft Security Essentials" was doing this, but I guess that is something different.

Dart without Dart-Editor: Refreshing

I'm trying to program in Dart but without the Dart-Editor. It works fine so far but its really annoying and slow to always call pub build after making a change to either html/css or dart code.
As far as I remember when launching the app with Dart-Editor you just have to refresh the page.
Is it possible to get this working without the editor?
Thanks!
You can use pub serve which is similar to the webserver integrated in the Darteditor.
If you are using Dartium as browser you can add --no-dart2js so pub serve doesn`t generate JavaScript (which is slow) but directly serves Dart which Dartium can process directly.
For other browsers it's of course convenient to use the integrated dart2js conversion.

Debugging web app on ipad without Mac

I'm tasked with fixing a bug on the mobile version of a project I just came on (and still learning my way around it). Its a heavy use 24/7 kinda job, so not keen on the trial and error guess/upload/test style of debugging.The bug is that almost none of the controls, particularly tabs, respond to user "clicks" on the ipad. The app was developed in asp.net MVC4 and I work on windows 7 in vs2012.
We are not a mac shop, but still need to support the Ipad and phone.
This is probably a simple question: but my searching keeps taking me
here: iOS6 - removed console log for IPad - how to use web inspector on windows?
and here: Accessing iOS Safari Web Inspector from Windows Machine.
I need a way to gather actually diagnostics, like what would be available in web inspector, without having to acquire a mac.
Use weinre. It runs a webserver that that can repond to a bookmarklet or <script> to run a remote inspector.
weinre is a debugger for web pages, like FireBug (for FireFox) and Web Inspector (for WebKit-based browsers), except it's designed to work remotely, and in particular, to allow you debug web pages on a mobile device such as a phone.
Get NodeJS, NPM, and a webkit-based desktop browser to run it.
Homepage: https://people.apache.org/~pmuellr/weinre/
Docs: https://people.apache.org/~pmuellr/weinre/docs/latest/
To install with yarn:
yarn add --dev weinre
then because it's no longer maintained, you may get TypeError: mime.lookup is not a function when you try to use it, then you have to edit node_modules/connect/lib/middleware/static.js and change require('mime') to require('mime-types') on line 21 (thanks). Then start with
yarn run weinre
If you now open the url showed there, you'll see the bookmarklet you can use etc. (Note: If using this from other computers, you may have to open local firewall ports, and if debugging a https site you may have to add a reverse proxy with cors headers.)

dart test dart:html without loading dartium

Is there any way to test a code with dart:html imported on it, without dartium being triggered.
I want to test HttpRequest to a JSON data and expected it to display it on terminal, and dart editor wants to open dartium EVERYTIME, which i think unnecessary.
Dartium contains the browser hosted Dart VM, which the relevant browser DOM bindings. When you run code that needs a browser DOM, such as dart:html, you will get Dartium running.
However, you can also use DumpRenderTree - which is a headless browser (ie, produces output to the console).
Take a look at these post for more about DumpRenderTree and Dart:
http://work.j832.com/2013/01/headless-browser-testing-dart.html
http://docs.drone.io/dart.html
http://japhr.blogspot.co.uk/2013/01/regression-testing-of-browser-dart-code.html

Resources