D3(SVG) browser support - svg

According to caniuse
http://caniuse.com/#search=svg
there is full support for SVG except for IE 7,8, but when I view in Chrome and Firefox, many examples don't work
For example both azimuthal and albers in the examples found here
https://github.com/mbostock/d3/tree/master/examples
Both work fine in Safari
My browser versions
Chrome
Version 21.0.1180.82
Firefox
14.0.1
Anyone care to comment as to why these examples aren't working?

As #Josh commented, the most likely reason is that you are viewing these examples out of your local file system, rather than using a local web server as described on the Wiki.
When running the examples locally, note that your browser may enforce strict permissions for reading files out of the local file system. Some examples use AJAX which works differently via HTTP instead of local files. To view the examples locally, you must have a local web server. Any web server will work; for example you can run Python's built-in server:
python -m SimpleHTTPServer 8888 &
Once this is running, go to http://localhost:8888/examples/.

Related

Is it possible to set a specific browser when using gatsby develop?

Windows 10 Pro x64
VS Code
Node 15.10.0
My default browser, for day-to-day work is Chrome, but when developing websites I've started using Firefox Developer. Is there a way to specify which browser I want Gatsby to open while I'm testing the site on my local machine?
Thanks everyone.
Is there a way to specify which browser I want Gatsby to open while
I'm testing the site on my local machine?
No, you can't.
According to gatsby-cli options, the -o or --open flags opens the default browser at localhost:8000 but you can't choose the browser, it will take the default system browser since it's a bash command, outside of Gatsby's scope.
You can make a PR to Gatsby's repository if you want with your proposal or you can dive into customizing the bash prompt, maybe this SuperUser answer enlights you: https://superuser.com/questions/350309/how-can-i-open-a-url-in-google-chrome-from-the-terminal-in-os-x

Chromium-Browser ignores --allow-file-access-from-files flag

Environment
I am using Chromium 78.0.3904.108 Built on Raspbian running on Raspbian 10 on a Raspberry 3b+.
I am opening up a bundled VueJs app via file:// protocol directly in the browser. The app files are locally available on the machine. Until now everything works as expected. The app displays and works fine !
Problem
The website files contain a html <video> tag to play mp4 video files, which are locally available as well. However, a console error is telling me Not allowed to load local resource: file:///home/path/to/the/video/file/abc.mp4
I am very aware of this issue, it's an inbuilt security feature of the browser. However, the machine will only load content owned by me, so I guess I should be safe ignoring the warning.
Expected behaviour
By passing --allow-file-access-from-files to chromium-browser I expected it would disable this security feature. Doesn't work. I tried --disable-web-security as well. Same result.
I tested the same vue app bundled into an electron executable and having the electron option "webSecurity" set to false, the content is able to play without the warning. However, since the playback performance in electron is notable lower than compared the chromium-browser directly, I was trying to use the browser directly.

Test Grunt served pages in Virtualbox

I'm developing some HTML-files using a lot of different libraries, but everything is compiled and served using grunt ('grunt serve'), which fires up my default browser and connects on 127.0.0.1:9000. I can copy/paste that URL into other browsers on my OS (Mac OS X) with no issues.
However, I also need to test in IE, where I normally use VirtualBox with browsers from modern.ie, but the URL is not available on those images (which makes perfect sense as it's a local IP). How do I make those URL's available to my VirtualBox images?
If I use my MAMP setup, I can access the URL's I've configured in my hosts file, but as I'm not using MAMP for this, that won't be an option.
Thanx in advance for any help!
/kim
Managed to get it to work, and as hgoebl said, it was a purely networking issue. Basically, I just followed this: http://naxoc.net/2013/10/22/windows-in-virtualbox-on-the-mac/ and everything works now.

How can I download a file using browser APIs in Linux?

There is an API in windows called URLDownloadToCacheFile that downloads data to the Internet cache and returns the file name of the cache location for retrieving the bits.
Is there any API (C/C++) in linux that downloads a file from internet?
There are some libraries (eg. curl, ...) that useful for downloading but I want a simpler API that does not deponds on any other libraries except browser.
Note that I want a C/C++ API, not a command line tool.
Thanks
A browser is an external application. On a typical Linux system, there's nothing which has the status comparable to that of IE on Windows. You can use Firefox as your browser; you can also completely uninstall Firefox and use only Chrome; you can even use w3m exclusively and no single GUI-based browser.
You seem to be somewhat confused about the differences between Windows and other operating systems.
There's no monolithic "browser" or "Internet cache" built into linux. In Windows you're simply using a function from a library they provide, but it's integrated into the OS (along with Internet Explorer).
There's really no parallel in linux. The OS is not tightly coupled with applications running on it. Using cURL, etc is how you approach what you're trying to do.
Like the other answers noted, there is no such thing as a built-in HTTP API on Linux systems, and you should be quick to accept that you need a HTTP library to do the task. But fear not, linking to libraries and deploying programs linked to libraries is much easier and less error-prone than under windows systems, so library dependencies are not that much of an issue.
libcurl is a well-established solution for HTTP and HTTPS.

JPlayer issues with Firefox 3.6.4

I'm having some issues with the JPlayer widget.
I'm using JPlayer 1.1.1 with Firefox 3.6.4 and I'm testing this locally on my laptop. I'm all setup to use local domains i.e. http://mylocaldomain, etc.
I have JPlayer in a folder under htdocs called myfolder that I access by going to http://myfolder. I have a test script setup just like the playlist demo on the JPlayer Web site (http://www.happyworm.com/jquery/jplayer/latest/demo-02.htm).
When I load my test script in Firefox it plays like half a second of the audio track. However, my script works fine using Safari and Chrome, and plays the tracks in sequence.
Is there a way to not use the .swf as I have been seeing in other posts as it's becoming really annoying trying to debug this for Firefox when it works in other browsers. I've tried various swfPath settings but it still doesn't work.
I just completed a JPlayer project using Firefox 3.6.10 as the main dev browser, and JPlayer 1.2.0, and I did not see an issue with it cutting off as you describe. You might try upgrading to JPlayer 1.2.
However there is this in the dev guide:
"Firefox 3.6 (Windows, Mac) †
...
* When using {oggSupport: true}, the browser appears to enable file seeking, which can cause the music to pause briefly when a new play position is selected."
Again, I don't think I saw the problem you mentioned. However, that means I do have working code. Have you tested on multiple machines, and what OS are you running Firefox on?
Try loading my application in your Firefox ( http://alinesoundscape.org/ )and see if it works. If so, I can post the relevant parts of my source and you can compare with what you have.

Resources