Skip to content

Commit

Permalink
[docs] add FAQ for console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerwang committed Jan 19, 2016
1 parent 6e616ed commit 74ddb72
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/For Users/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@

[TOC]

## 1. `var crypto = require('crypto')` gets a wrong object
## console.log doesn't output to Linux terminal
`--enable-logging=stderr` should be used in the command line

## `var crypto = require('crypto')` gets a wrong object
Chromium has its own global `crypto` object which can't be overwritten. So you can't use the same variable name `crypto`. Changing your variable name to something else, like `nodeCrypto`, will work.

## 2. Images are broken in AnugarJS and receive `Failed to load resource XXX net::ERR_UNKNOWN_URL_SCHEME` in DevTools
## Images are broken in AnugarJS and receive `Failed to load resource XXX net::ERR_UNKNOWN_URL_SCHEME` in DevTools
AngularJS added `unsafe:` prefix for unknown scheme to prevent XSS attack. URLs in NW.js and Chrome apps are started with `chrome-extension:` scheme, which is unknown to AnuglarJS. The solution is to config the whitelist of known schemes with AngularJS by adding following lines:

```javascript
Expand All @@ -17,7 +20,7 @@ myApp.config(['$compileProvider',
}]);
```

## 3. How to leave fullscreen mode with ESC key?
## How to leave fullscreen mode with ESC key?
Usually users expect to use ESC key to quit fullscreen mode. By default, NW.js don't bind ESC shortcut for leaving fullscreen mode, but providing APIs for entering and leaving fullscreen mode. It will give developers more control on fullscreen mode.

To enable ESC key for leaving fullscreen mode, you can use [Shortcut API](../References/Shortcut.md):
Expand Down

0 comments on commit 74ddb72

Please sign in to comment.