dartium

Running dart in a web server

南楼画角 提交于 2019-12-12 07:57:32
问题 How do I run dart in a server? say in localhost or any web server? Currently google provides a dart editor which executes the code in dartium browser. Also even if I get to run it on a server would it be visible to others viewing the page in a browser other than dartium? 回答1: When you create a new "Web Application" using the Dart Editor, it creates a .html file and a .dart file. The html file uses a tag to link to the .dart file, eg: MyApp.html //contains <script type="application/dart" src=

Why does this use of getImageData leak memory

帅比萌擦擦* 提交于 2019-12-11 03:46:50
问题 I would like to do some image processing with Dart while using requestAnimationFrame to continually update the image I am processing. The following code will leak memory until the tab crashes in Dartium. import 'dart:html'; import 'dart:async'; final CanvasElement m_canvas = querySelector("#canvas"); void main() { scheduleMicrotask(requestRedraw); } void requestRedraw() { if(true) { window.requestAnimationFrame(draw); } } void draw(num _) { var context = m_canvas.context2D; context.clearRect

How to start Dartium / Chrome in checked mode for Dart in Windows?

徘徊边缘 提交于 2019-12-10 17:37:49
问题 According to the docs: https://www.dartlang.org/docs/dart-up-and-running/contents/ch04-tools-dartium.html In Mac and Linux you can append a --checked but this does not work for Windows. How do I launch Dartium with the checked flag in Windows? 回答1: Apparently, using DART_FLAGS works as well for Windows. see https://www.dartlang.org/tools/dartium/#using-command-line-flags Command flags are prefixed with / on Windows, so you use: C:\path\to\dartium\chrome.exe /DART_FLAGS='--checked' 回答2: You

Dart HttpRequest polling

我的梦境 提交于 2019-12-10 07:22:25
问题 I have a web app that have a Timer that fires a poll to get data every 3 seconds. It works fine for about 2.5 minutes then Chromium crashes. My request Dart looks like this HttpRequest.getString('data/get_load_history_recent.json') .then((e) => _recentHistoryResponse(e)) .catchError((e) => _recentHistoryError(e)); Can you think of any reasons why this would happen? I assume it's a memory leak... Edit: Here is my _recentHistoryResponse() void _recentHistoryResponse(String data) { Map obj =

Is there anyway to invoke a Dart REPL on a website, when using Dartium?

╄→尐↘猪︶ㄣ 提交于 2019-12-07 04:44:28
问题 I now know that I can't interact with Dart via the console, but I was hoping that there may be another way to invoke a REPL within Dartium. Basically, what I would like to be able to do is: 1. Go to a website in Dartium 2. Invoke some sort of Dart REPL 3. Mess about with the DOM, CSS etc., using Dart commands, rather than Javascript. Is this possible at all? Or, is the Dart development model all Edit/Refresh? Cheers Andy 回答1: Chrome Dev tools in Dartium will now let you do this very nicely.

Is addIceCandidate implemented in Dartium?

随声附和 提交于 2019-12-06 04:08:17
I'm trying to call: peerConn.addIceCandidate (where peerConn is an instance of RtcPeerConnection) and I'm getting: NotSupportedError: Internal Dartium Exception Is addIceCandidate supported? And what is the status of WebRTC in Dartium? There exists a issue on the Dart bug tracker regarding this problem: Issue 15008 - RtcPeerConnection.addIceCandidate results in a NotSupportedError: Internal Dartium Exception It seems that (at the moment) the only workaround is to use dart2js with Chrome... The newest Versions (bleeding edge) seem to fix this problem. You can download them right here . 来源:

Configuring dart content_shell on ubuntu trusty

ε祈祈猫儿з 提交于 2019-12-05 19:04:31
I am trying to run xvfb-run -s '-screen 0 1024x768x24' pub run test -p content-shell on Ubuntu Trusty. Dart and content shell are installed in the following way: # Install Dart curl https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --import --no-default-keyring --keyring /etc/apt/trusted.gpg.d/google.gpg curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list apt-get update apt-get install --assume-yes dart=1.15.0-1 # Content shell and dartium curl https://storage.googleapis.com/dart-archive/channels/stable

Is there anyway to invoke a Dart REPL on a website, when using Dartium?

眉间皱痕 提交于 2019-12-05 10:55:58
I now know that I can't interact with Dart via the console , but I was hoping that there may be another way to invoke a REPL within Dartium. Basically, what I would like to be able to do is: 1. Go to a website in Dartium 2. Invoke some sort of Dart REPL 3. Mess about with the DOM, CSS etc., using Dart commands, rather than Javascript. Is this possible at all? Or, is the Dart development model all Edit/Refresh? Cheers Andy Chrome Dev tools in Dartium will now let you do this very nicely. Dart edit model is Edit/Refresh. Maybe you are looking for something like http://try.dartlang.org/ 来源: https

Dart BrowserClient POST not including my cookies

随声附和 提交于 2019-12-01 10:34:34
I'm doing a BrowserClient POST across domains and don't see my cookies being included. This the response I'm getting: When I send another POST request, I don't see the cookies being included: Going straight to the test page, I can see the cookies being included: The Dart code I use to make a POST: var client = new BrowserClient(); client.post(url, body: request, headers:{"Content-Type" : "application/json", "Access-Control-Allow-Credentials":"true"}).then((res) { if (res.statusCode == 200) { var response = JSON.decode(res.body); callback(response); } else { print(res.body); print(res

dart: debugging client/server communication for dart client and existing rest api?

跟風遠走 提交于 2019-12-01 01:05:05
I have a rest api (developed in django/python) which i run locally and want to develop a simple client application in dart. This client uses XMLHttpRequest to communicate to a local django development server. The problem is the default run configuration in the Dart Editor launches it's own web server and than either dartium or the system browser with dart2js. Which will both obviously violate the cross origin policy when i try to access my rest api. I'm wondering what the best setup would be to test client/server communication - should i configure my rest api to proxy the :3030 port which is