<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Palouxic</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Palouxic"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Palouxic"/>
	<updated>2026-09-13T03:33:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Using_the_Moodle_App_in_a_browser&amp;diff=45599</id>
		<title>Using the Moodle App in a browser</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Using_the_Moodle_App_in_a_browser&amp;diff=45599"/>
		<updated>2014-06-27T09:34:12Z</updated>

		<summary type="html">&lt;p&gt;Palouxic: /* Advantages and disadvantages of using Chromium/Google Chrome */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Chromium or Google Chrome browser are the recommended tools for Moodle Mobile development. But remember that if you are going to use functions provided by Phonegap you should use the Android SDK or iOs developer tools.&lt;br /&gt;
&lt;br /&gt;
== Differences between Chromium and Google Chrome ==&lt;br /&gt;
&lt;br /&gt;
Google Chrome is the Chromium open source project built, packaged, and distributed by Google. We can say that Chromium is Google Chrome without the &amp;quot;Google&amp;quot; add-ons&lt;br /&gt;
&lt;br /&gt;
See https://code.google.com/p/chromium/wiki/ChromiumBrowserVsGoogleChrome for more information&lt;br /&gt;
&lt;br /&gt;
We recommend to use Chromium instead Google Chrome&lt;br /&gt;
&lt;br /&gt;
== Advantages and disadvantages of using Chromium/Google Chrome ==&lt;br /&gt;
&lt;br /&gt;
Main advantages&lt;br /&gt;
* Quick development&lt;br /&gt;
* DOM inspector&lt;br /&gt;
* Network monitor&lt;br /&gt;
* Database (local storage) inspector&lt;br /&gt;
* Emulation options&lt;br /&gt;
&lt;br /&gt;
Disadvantages&lt;br /&gt;
* You can&#039;t test/develop using Phonegap APIs and Plugins&lt;br /&gt;
* If you use custom Phonegap code (including plugins) you will need to edit the mm.cordova.js for &amp;quot;emulate&amp;quot; those APIs in a browser&lt;br /&gt;
* You will always need to test in a real device and emulator prior to a production release&lt;br /&gt;
* You will need to verify that your CSS/layout works the same in an Android/iOs device&lt;br /&gt;
&lt;br /&gt;
== Installation == &lt;br /&gt;
&lt;br /&gt;
Install the “Chromium” browser just downloading it from https://download-chromium.appspot.com/&lt;br /&gt;
&lt;br /&gt;
In order to be able to access any domain via AJAX from the local file:/// protocol, you must run Chromium or Google Chrome in Unsafe mode adding this param:&lt;br /&gt;
&lt;br /&gt;
 --allow-file-access-from-files --disable-web-security&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: I strongly recommend you create a new link or application launch called &amp;quot;Chrome Unsafe&amp;quot; and use it only for testing the app. Better if you only use this browser for development&lt;br /&gt;
&lt;br /&gt;
How to open the browser:&lt;br /&gt;
&lt;br /&gt;
 &amp;quot;Path to chrome\chrome.exe&amp;quot; --allow-file-access-from-files --disable-web-security&lt;br /&gt;
&lt;br /&gt;
or in Mac (you can use Automator for creating an app bundle)&lt;br /&gt;
&lt;br /&gt;
 open -a &amp;quot;Google Chrome&amp;quot; --args --allow-file-access-from-files --disable-web-security&lt;br /&gt;
&lt;br /&gt;
or for Chromium&lt;br /&gt;
&lt;br /&gt;
 open -a /Applications/Chromium.app --args --allow-file-access-from-files --disable-web-security&lt;br /&gt;
&lt;br /&gt;
In Mac you can use Automator for creating a launching app&lt;br /&gt;
&lt;br /&gt;
== Browser Settings ==&lt;br /&gt;
[[{{ns:file}}:moodlemobile_developer.png|thumb|300px]]&lt;br /&gt;
You should develop always with the &amp;quot;Developer tools&amp;quot; panel open, you can open that panel with F12 (cmd + alt + i in Mac) or &amp;quot;Developer tools&amp;quot; in the Tools menu.&lt;br /&gt;
&lt;br /&gt;
[[{{ns:file}}:moodlemobile_options.png|left]]  Once opened, click on the wheel top-right corner to see the General options, you must Disable the cache there (this setting will work only if you have the Developer tools panel open)&lt;br /&gt;
&lt;br /&gt;
You can dock or undock into a separate window the developer panel using the &amp;quot;Dock&amp;quot; option just at the right of the settings wheel, you can move the developer panel to your right and resize the main browser window to emulate a Mobile device&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Inspecting and changing the DOM ==&lt;br /&gt;
&lt;br /&gt;
Using the &amp;quot;Elements&amp;quot; option you can manipulate the DOM:&lt;br /&gt;
&lt;br /&gt;
* Add/modify style to elements&lt;br /&gt;
* Delete elements&lt;br /&gt;
* Move elements&lt;br /&gt;
* Inject HTML code&lt;br /&gt;
&lt;br /&gt;
You have complete information here: https://developer.chrome.com/devtools/index&lt;br /&gt;
&lt;br /&gt;
And also a free interactive course here: https://www.codeschool.com/courses/discover-devtools&lt;br /&gt;
&lt;br /&gt;
== Monitor XHR (ajax) requests ==&lt;br /&gt;
[[{{ns:file}}:moodlemobile_network.png|thumb|300px]]&lt;br /&gt;
&lt;br /&gt;
With the network panel you can check and filter all the HTTP request send from the app to your Moodle server.&lt;br /&gt;
&lt;br /&gt;
You can preserve the log in the navigation, filter by type of requests and also see complete information of all the requests made to the server where is hosted your Moodle installation.&lt;br /&gt;
&lt;br /&gt;
You can also identify with resources takes long to load&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Browsing the data base (local storage) ==&lt;br /&gt;
[[{{ns:file}}:moodlemobile_localstorage.png|thumb|300px]]&lt;br /&gt;
&lt;br /&gt;
The Mobile app stores information in the local HTML5 storage system&lt;br /&gt;
&lt;br /&gt;
The local storage system is based on key-value pairs, since we use a library called Backgone-localstorage, values are store following this format:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Tables&amp;quot; are stored like an entry containing an array of keys pointing to records in a table&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Records&amp;quot; are store like entries linked from the entry representing a table&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Console, log and errors ==&lt;br /&gt;
[[{{ns:file}}:moodlemobile_log.png|thumb|300px]]&lt;br /&gt;
&lt;br /&gt;
The console panel is used for displaying the app log and errors, you can also configure Chrome for displaying there XHR requests&lt;br /&gt;
&lt;br /&gt;
In order to view the app log, you need first to enable Logging in the app (Options / Developers / Enable logging)&lt;br /&gt;
&lt;br /&gt;
You can use the console also for executing javascript commands, the console has access to the complete MM global object so you can call from there to core APIs functions of the app&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emulating devices ==&lt;br /&gt;
[[{{ns:file}}:moodlemobile_emulation.png|thumb|300px]]&lt;br /&gt;
&lt;br /&gt;
You can emulate mobile devices changing orientation, resolution, geo-location, touch events... It&#039;s not recommended to use de &amp;quot;Emulation Device&amp;quot; option because it just changes the user-agent and you could get some fails because of the jQuery Swipe library.&lt;br /&gt;
&lt;br /&gt;
The best option to test with the browser is just rescaling the window to get a new viewport size or use the screen settings in the &amp;quot;Emulation&amp;quot; screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[https://developer.chrome.com/devtools/index Chrome Developer Tools help]&lt;br /&gt;
&lt;br /&gt;
[[Category: Mobile]]&lt;/div&gt;</summary>
		<author><name>Palouxic</name></author>
	</entry>
</feed>