Don’t Use Chrome Command-Line Switch `enable-gpu-memory-buffer-compositor-resources` It Will Break Your HTML5 Videos!

For Chrome/Chromium.

When you “talk to the video-renderer”, to specify that all compositor resources should be backed by GPU memory buffers,
You use the “feature flag” --enable-gpu-memory-buffer-compositor-resources,
while good for various developing aspects, it will show you green video screen instead of the video (on YouTube).

Please do not use it for now.

Make Chrome Faster

1. Use Chrome/Chromium Of x64bit, if your machine can handle it.

2. Install those both official Chrome-extensions:
https://chrome.google.com/webstore/detail/dalkfakmooljfejnddeaibdkgbbogpea
https://chrome.google.com/webstore/detail/pcgokfnmpaefeofjpbicabmcadpcnhon

3. Access chrome://flags/ and change the following values,
you may easily reach either of those by copy&&paste them into the address-bar.

👉 chrome://flags/#num-raster-threads ➧4
👉 chrome://flags/#default-tile-width ➧1024
👉 chrome://flags/#default-tile-height ➧1024

👉 chrome://flags/#enable-fast-unload ➧Enable
👉 chrome://flags/#smooth-scrolling ➧Disable
👉 chrome://flags/#enable-quic ➧Enable
👉 chrome://flags/#enable-zero-copy ➧Enable
👉 chrome://flags/#enable-site-per-process ➧Enable
👉 chrome://flags/#v8-cache-options ➧’Cache V8 parser data.’
👉 chrome://flags/#v8-cache-strategies-for-cache-storage
➧’Aggressive’
👉 chrome://flags/#enable-scroll-anchoring ➧Disable
👉 chrome://flags/#enable-pointer-events ➧Enable
👉 chrome://flags/#passive-listener-default ➧’Force All True’
👉 chrome://flags/#document-passive-event-listeners ➧Enable
👉 chrome://flags/#passive-event-listeners-due-to-fling ➧Enable
👉 chrome://flags/#expensive-background-timer-throttling ➧Enable
👉 chrome://flags/#enable-nostate-prefetch ➧’Enabled Prerender’
👉 chrome://flags/#enable-resource-prefetch ➧’Enable Prefetching’
👉 chrome://flags/#delay-navigation ➧Disable

4. Just before the restart required in stage [3] (above),
close all other tabs (other than chrome://flags/),
access chrome://net-internals/#dns in a new-tab, and click the ‘clear host cache’, you can safely close the chrome://net-internals/#dns now, and back in the chrome://flags/ click on the big-blue ‘relaunch now’ button.

5. Run Chrome with the following command-line switches:

--enable-accelerated-vpx-decode="0x03" --prefetch-search-results --disable-pinch --disable-in-process-stack-traces --enable-tcp-fastopen --enable-threaded-compositing --enable-gpu-scheduler --use-double-buffering --enable-hardware-overlays --enable-partial-raster --disable-speech-api --ipc-connection-timeout="90"  --enable-gpu-memory-buffer-compositor-resources --enable-gpu-memory-buffer-video-frames --enable-native-gpu-memory-buffers --disable-payment-request --disable-3d-apis --disable-logging --disable-presentation-api --enable-rgba-4444-textures --v8-cache-options="data" --v8-cache-strategies-for-cache-storage="aggressive"

you may use a .bat or .cmd batch file if it is easier for you,
or use my https://github.com/eladkarako/iniRun project.
here is my ini file (for chromium :])

[Information]
Parent_Folder=C:\Users\Elad\AppData\Local\Chromium\Application

Arguments=--force-device-scale-factor="1.2" --enable-accelerated-vpx-decode="0x03" --allow-outdated-plugins --ppapi-flash-path="C:\Windows\System32\Macromed\Flash\PEPFLA~1.DLL" --ppapi-flash-version="24.0.0.221" --prefetch-search-results --enable-lcd-text --enable-font-antialiasing=1 --ppapi-antialiased-text-enabled=1 --no-referrers --reduced-referrer-granularity --force-ui-direction=ltr --enable-pepper-testing --keep-alive-for-test --disable-pinch --ipc-connection-timeout="90" --disable-hang-monitor --disable-in-process-stack-traces --enable-tcp-fastopen --enable-threaded-compositing --enable-grouped-history --ash-md=enabled --material-design-ink-drop-animation-speed="fast" --show-md-login --top-chrome-md="material" --secondary-ui-md="material" --enable-gpu-scheduler --show-md-login --disable-md-oobe --use-double-buffering --desktop-window-1080p --enable-hardware-overlays --enable-partial-raster --disable-speech-api --enable-gpu-memory-buffer-compositor-resources --enable-gpu-memory-buffer-video-frames --enable-native-gpu-memory-buffers --disable-payment-request --disable-3d-apis --disable-logging --disable-presentation-api --enable-rgba-4444-textures --v8-cache-options="data" --v8-cache-strategies-for-cache-storage="aggressive" --enable-threaded-compositing --no-referrers


;;// Overrides the timeout, in seconds, that a child process waits for a
;;// connection from the browser before killing itself.
;;const char kIPCConnectionTimeout[]          = "ipc-connection-timeout";


Full_Path=C:\Users\Elad\AppData\Local\Chromium\Application\chrome.exe

Run_Mode=SW_SHOWMAXIMIZED

search this blog for newer ways to download all recent command-line switches and this might also help: https://github.com/eladkarako/Chrome-Command-Line-Switches :]

Enjoy!

JavaScript Snippet – Get Chrome’s Version Using JavaScript

(function(match){                         /* just as string. ie. "57.0.2947.0"*/
  match = null === match ? "" : match[1];
  return match;
}(
  (self.navigator.appVersion + self.navigator.userAgent).match(/Chrome\/([\d\.]+)\ /i)
));

A trick: Since the version exist both in navigator.appVersion and navigator.userAgent, combining them to one string, and applying a little regular-expression match, using regex-backtrack, has a better chance of “finding something” :]


This one also breaks the Semantic Versioning and convert each value to a number, which may come-in handy for any type of numeric-comparison.

(function(match){                         /* as array of numbers (by the order of reading, left to right). ie. [57, 0, 2947, 0]*/
  match = null === match ? "0.0.0.0" : match[1];
  match = match.split(".").reduce(function(carry_result, item){ return [].concat(carry_result,Number(item)); }, []);
  return match;
}(
  (self.navigator.appVersion + self.navigator.userAgent).match(/Chrome\/([\d\.]+)\ /i)
));

Chromium Code-Search

https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/

https://cs.chromium.org/chromium/src/ui/gl/gl_switches.cc?q=_switches.cc&sq=package:chromium&dr

https://chromium.googlesource.com/chromium/src/+/master/ui/gl/gl_switches.cc

raw content:

https://cs.chromium.org/codesearch/f/chromium/src/ui/gl/gl_switches.cc?cl=0


https://cs.chromium.org/chromium/src/ui/gl/gl_switches.cc?q=_switches.cc&sq=package:chromium&dr
https://chromium.googlesource.com/chromium/src/+/master/ui/gl/gl_switches.cc
https://cs.chromium.org/codesearch/f/chromium/src/ui/gl/gl_switches.cc?cl=0

for example, here are all the “switches” files, in raw mode, which may help you include them in a script using cURL or wGet:

https://cs.chromium.org/codesearch/f/chromium/src/android_webview/common/aw_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ash/common/ash_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/base/base_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/base/i18n/base_i18n_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/base/test/test_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/blimp/client/core/switches/blimp_client_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/chrome/browser/supervised_user/experimental/supervised_user_filtering_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/chrome/common/chrome_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/chrome/test/base/test_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/chromecast/base/chromecast_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/chromecast/net/net_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/chromeos/chromeos_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/autofill/core/common/autofill_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/browser_sync/browser_sync_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/component_updater/component_updater_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/crash/content/app/crash_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/crash/content/app/crashpad_win.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/data_reduction_proxy/core/common/data_reduction_proxy_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/dom_distiller/core/dom_distiller_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/error_page/common/error_page_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/feedback/feedback_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/flags_ui/flags_ui_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/google/core/browser/google_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/infobars/core/infobars_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/invalidation/impl/invalidation_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/metrics/metrics_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/nacl/common/nacl_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/os_crypt/os_crypt_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/policy/core/common/policy_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/precache/core/precache_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/search/search_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/search_engines/search_engines_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/signin/core/common/profile_management_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/signin/core/common/signin_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/sync/driver/sync_driver_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/tracing/common/tracing_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/translate/core/common/translate_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/components/variations/variations_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/content/public/common/content_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/content/shell/common/layout_test/layout_test_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/content/shell/common/shell_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/extensions/common/feature_switch.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/google_apis/gaia/gaia_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/google_apis/gcm/engine/gservices_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/gpu/command_buffer/client/gpu_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/gpu/config/gpu_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/headless/app/headless_shell_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ios/chrome/browser/chrome_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/media/base/media_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/media/midi/midi_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ppapi/shared_impl/ppapi_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/app_list/app_list_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/base/ui_base_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/compositor/compositor_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/display/display_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/events/event_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/gfx/x/x11_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/gl/gl_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/keyboard/keyboard_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/message_center/message_center_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/native_theme/native_theme_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/ozone/public/ozone_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/views/views_switches.cc?cl=0
https://cs.chromium.org/codesearch/f/chromium/src/ui/wm/core/wm_core_switches.cc?cl=0

also may be useful:

https://cs.chromium.org/codesearch/f/chromium/src/chrome/app/chrome_exe_main_win.cc?cl=0

this windows-batch script will download and append each of the files, to a single “switches.cc” file, then it will open it with Notepad++.
(Just put all the files in “switches_urls.txt” file, place wGet.exe somewhere and modify the path to Notepad++.exe)

@echo off
::cleanup
if exist switches.cc   del /f /q switches.cc   >nul

::download
call d:\DOS\wGet\wget.exe         ^
--input-file="switches_urls.txt"  ^
--user-agent="Mozilla/5"          ^
--no-check-certificate            ^
--secure-protocol="auto"          ^
--auth-no-challenge               ^
--no-directories                  ^
--directory-prefix=.              ^
--output-document="switches.cc"

::open for viewing (optional)
call "D:\Software\Notepad++\Notepad++.exe" switches.cc

Chromium API Keys

When you build Chromium yourself, or download a Chromium nightly-build, you need to provide API-key, a secret-phrase and a client-id,
running Chromium without either of those three phrases will seriously compromise Chromium’s functionality.

The is a sort of “inner-Google” page on how to generate, and use the API-Keys needed to make Chromium a properly, fully functional Chrome-compatible browser (including Syncing your bookmarks and other stuff..)

There is an issue, however, with that page (https://www.chromium.org/developers/how-tos/api-keys) which has not been-updated for a while, especially on the names of the API-services, one, needs to enable in-order to use Chromium in a fully functional mode,

icompile.eladkarako.com_google_console_api_services_list_helper_for_chromium_api_keys

I’ve gathered those services (including a direct link for you to use in-order to activate it)
the following list (Google API-console) is ordered as:

– Name.
– Description.
– URL.

the list of API-services is sorted (A,B,C..) by the Name of the API-service.

Continue reading

Stuff And Cache You Should Probably Delete From Your Google-Chrome

Either do it manually,
or add few “include” items to your CCleaner configuration-file.

first let’s break the profile-location for each of the operating-systems supported (Windows XP, Windows 7 and later, MacOS and Linux based – not including ChromeOS)

Windows (XP, 7 and later..)
C:\Documents and Settings\Elad\Local Settings\Application Data\Chromium\User Data\
C:\Documents and Settings\Elad\Local Settings\Application Data\Google\Chrome Canary\User Data\
C:\Documents and Settings\Elad\Local Settings\Application Data\Google\Chrome SxS\User Data\
C:\Documents and Settings\Elad\Local Settings\Application Data\Google\Chrome\User Data\
C:\Users\Elad\AppData\Local\Chromium\User Data\
C:\Users\Elad\AppData\Local\Google\Chrome Canary\User Data\
C:\Users\Elad\AppData\Local\Google\Chrome SxS\User Data\
C:\Users\Elad\AppData\Local\Google\Chrome\User Data\

Mac OS X:
~/Library/Application Support/Google/Chrome Canary/
~/Library/Application Support/Google/Chrome SxS/
~/Library/Application Support/Google/Chrome/

Linux:
~/.config/google-chrome/

the folder-location you should empty-recursively or (simply delete the entire folder – it will be regenerated on next Chrome run) – sorry for the slash direction, on Mac/Linux just switch \ to / :)

\Crash Reports\
\Crashpad\
\Default\Application Cache\
\Default\Cache\
\Default\File System\
\Default\GPUCache\
\Default\IndexedDB\
\Default\Local Storage\
\Default\Media Cache\
\Default\Pepper Data\
\Default\Service Worker\ScriptCache\
\Default\Session Storage\
\ShaderCache\

You probably want to switch from Elad to your user-name,
here is an example on how it should look inside (for example) ccleaner.ini file:
Include8=PATH|C:\Documents and Settings\Elad\Local Settings\Application Data\Chromium\User Data\Default\Cache\|*.*|RECURSE

feel free to run the following code in your console,
to generate a proper list which you can add to your CCleaner (or any batch file for example..)

when copy&paste don’t forget to
– change your user-name to something other than ‘Elad’, unless your name is ‘Elad’ too, in which case – this is awesome!! (you can send me email to say hello)
– remove the prefix and suffix of " chars from console :)
– make sure the start_from is indeed starting from first-new index inline,
this is tricky since ccleaner.ini is not sorted nicely, so you better drop its content into EditPlus and sort it by “numeric value”,
quickly find which one is the last line starting with “IncludeXXXXX=” the start_from should be this index plus one,
for example if your last “IncludeXX” line is Include41=PATH|C:\Users\Elad\AppData\Roaming\Macromedia\Flash Player\#SharedObjects|*.*|RECURSE – change the start index from 15 to 42 :)

<_p_r_e_>eJy9Vt1P2zAQf6/U/+HUl7Qla7RpexkfEms7hrRJiAztgaDKSq6pwbEt22Ew4H+f3SRNoEk1pImHqs59/e5+d77kQCoERnh6OLgmt0THikozOOr3hsucx4YKPlSoc2Z8kEosKcMFEzFxisViKViCSvtgxOI3ldiQ5BrVgpMMfdCGKLNYKpGNHvo9gGAMXKiMMPoHYRw40cYaDuvzRKFkJMZhcBlFUXC1F6S+5432nUNnLjZAp26SEVmXpUcPoNDkioPeQHlzRhKvkf5oH54cpAMtiLAIl1elpBtqKdScxKsarsu04AS2KNyO8MKicqzymshcrzphYA+8KPLs38sw+0WYp+KwXWwZ/Rl31GDmA+UJ3lVpBIFNGPCOZJKhfT7lMcsT/Pjh8Oz457fH6efownKqI0dwdCzljBgSfbdZsmi6srNB82xtAWvFDJfEokanDgKT2ZfH8WT8eD6fXpyH8wKw7J1XArnSQqMoT4f1wFlZkaQrv0jE2bn0a0K8ZmyvZgGgjYdrQfnQi7gdRDfJGblBi2EEEGCCp8CoNu8YtVK9zqaccPeLBdeC4YSJdFjV4GK6cxNwXVet6veeSnOeM+ZOfvF4WQ0AgGf5jWYizjPkRgPhCYRojMXXUUF5wXVDanvAaDEkBed1H+pGeBWE/38gToRIGZZQCFPCibp/O7zwLnwzsB1AxU0o41Z3obwM/9KFnf6vpfg1wXbz94pI21GuugZbEb2Cc5RCGf0M0Smk3dYNWbU2njVnarcotlp1a77aHQrhvbaLolV/cnbR7bxZWq3aco6MUCRt9/+BCSU70j5DKVtasNGHqG5pjPBLqBtU9nn9Uu+OF6LWjqiWnMIVse+IpmuzTwPX6kFD8P5Tvzdyq+wgsN8VR38BwMGgaA==

which will generate about 118 items:

<_p_r_e_>eJy9201r20AQBuB7of/B5xxarfVdQiG10zTQQogaetFlkbaxqCwJSS4J5Mc3aZOGgKTZmZ3J1Vi7b4TneWGXHHe9+fj2zXlT1IfSqPDi5PuXu82HfNsWh71pxmGlm3KVmXGsmushP611mX9tC10/f3bSdXVV6LFqm9VWjzrf7Pp2Xx32+dVg+sePej3sVpema/txyO+O3h3dXZ5uri6z0+e9I8m9u/tnp7eNhbbdmp/6UI8vvrvRxc7M5EiEcyztnQrv/bmqzSq7HUazn06w9oQTnF1cLbyAtRLe/rwpzY0pt59m9l8L7//46Nj2+nruHfjCGb6ZstJLI7AOhBNcmK57+mw6gZR/Twky0/+uCrP60fa/TJ9nRV9149IrkULxOdAwPHxv+achZWS206Xpl/5+FhXP2va6Nv8CmPtfYKP7W1w5rVmEtMkxW1Q+C5FABGRp+SxuWmZaysHip2UOsMx8Fkkt0ywXm89CqmUUoOR8Flwts1gUns9iq2UesPx8FmMt04BF6L+Gu9RS9F8DY1RBBq9hM1iWgYDG2U2Ga8pAgOKJELM1GQjg+3J/ZEcGAgRPB1oKIWDvdAiwHQMBdqejLFdjIADudA6gFwMBa6eDWJRiIGDrdBiwEUMBVKejgHUYistK7cJQnFtUEYbi+oItGPJ7i2vAkN9a6/YL+XGlN1/ILyyu9UJ+WSmNF/Kbim67iB9TfNNF/IzSWi7iV5PScBG/lpR2i0TFpDZbJMooqtUiUVXBRov+O/rw0ONu98v/ffrvrsQrtyghLzzbQFFKWRPZLLHnssnSwsplYbAJ4rXL8svCx77L2oDcceCyuIXIceiyAShtHLksDwoakyaUKmNMGluUeDFpikHJEnhu3e9qEniGnS5iEniIeW9ZEniy3a9QEnjCue5HEnjWWS4/EnjoeW42Enj8+a4tEnj6ue4kElgBrguH1FkGqqapMxcoWVNnPUBlU6wX6EP+FIsF5gQ/xfLgdDyfYpFAn72nWB2IB+spFgbKqXmKJYF0JK48LAfkA2/lYeefeJytPOzkEw+rlec2/1RIleemAopR5bkpASKqPCQMOEGVh1TBmk/lIR2g26k8pAY4OJVCKkBRUynk/KPJVAo5+AQvFXLkiVYq5ISTnFTIySYZqejTTfZR0UceZ6OiCzDv4vH7h38V+AP0XDnX

naturally you won't need all of them,
but you might do!

especially since:
- Chromium, Chrome and Chrome Canary can live in same computer quite happily :]
- folders that won't exist would simply be skipped,
- you might use the portable ccleaner version, where you might want to move the installation around few computers (on DiskOnKey or network location for example)
--- in this case you might even want to re-run the script for each user-name used (including Admin/Administrator/other.. accounts)
- better not use those fancy
%Profile% and other current profile shortcuts, the web is filled with stories about cases where CCleaner has emptied the entire hard-drive or user accounts (desktop and all!!!) because of “won’t fix” bug that (apparently still exist in newer versions).
— so don’t take a change and only use direct-folder names…

Vary: Accept-Encoding

Specify a Vary: Accept-Encoding header

bootstrapcdn-vary-accept-encoding-2

Bugs in some public proxies may lead to compressed versions of your resources being served to users that don’t support compression. Specifying the Vary: Accept-Encoding header instructs the proxy to store both a compressed and uncompressed version of the resource.
Continue reading

Force Chrome Password Saving By Removing Event Handlers – The JSNinja Way!!!

(function (new_item) {
  document.querySelector('html').style.display="none"; //limit repaint.

  Array.prototype.forEach.call(document.querySelectorAll("*"), function (item) {
    new_item = item.cloneNode(true);
    item.parentNode.replaceChild(new_item, item);
  })

  document.querySelector('html').style.display="inherit";
}());

a more advanced method is removing the textual event-attribute,
but it is needed to be done AFTER the clone method (or all the attributes will be back… :( )

NodeList.prototype.forEach = Array.prototype.forEach;
NodeList.prototype.map = Array.prototype.map;

var attributes, new_element;

document.querySelectorAll("*").forEach(function(element){
  attributes = Object.keys(element.attributes).map(function(key_index){
    return element.attributes[key_index].nodeName
  });

  attributes = attributes.filter(function(attribute){ return 0 === attribute.toLowerCase().indexOf("on") }); /* keep similar to events */

  /* remove event-handlers (dom level 2 and 3) */
  new_element = element.cloneNode(true);
  element.parentNode.replaceChild(new_element, element);

  attributes.forEach(function(attribute){ 
    //element[attribute] = null; //remove reference to ease up memory (override with empty) - event as DOM-handle.  --not needed (clone method is more effictive)
    element.removeAttribute(attribute); //remove event text - event as attribute
  });

  
})

at this point the page (unless continuously renewing the event handlers..) is event free, placing the username, password, etc.. and submitting the form (either by submit button, which almost always has a non-ajax alternative, even on full ajax page, to better support older browsers – or executing a javascript code manually from console) will trigger Chrome’s password saving mechanism,
you are not necessarily need to be successfully logged-in,
all it means is that the login-data will be available next time you’ll be visiting the page, and then, naturally use the page without any modification (as it is)…

Bring Adobe Flash Back To Chromium (Solved)

ahhh… I had to figure out this one for myself from the source-code of Chromium (Chrome) project at:
http://src.chromium.org/svn/trunk/src/chrome/common/chrome_switches.cc and http://src.chromium.org/svn/trunk/src/base/base_switches.cc… :(

Apparently-
New Chromium versions does not have Flash anymore!
– Chrome (regular and Canary) still does.

also, and there are no-people figuring out the solution yet, (as far as Googling around shows..)
so this post should be the first one to explain how to re-enable Adobe Flash on New Chromium installations.

it should be compatible with Windows, Mac and Linux installations.

Chromium not just disable Flash, but it does not ship with the ‘pepflashplayer.dll’,
in fact- the folder, named PepperFlash, which is the code-name for the embedded plugin for Flash, is empty:

icompile.eladkarako.com_bring_flash_back_to_chromium_solved__empty_pepperflash_folder

you can look for pepflashplayer.dll in the Google-Chrome-Canary or regular versions and copy it to the folder but it won’t do anything (check using chrome://flash/)
icompile.eladkarako.com_bring_flash_back_to_chromium_solved__no_flash

for Chromium’s plugin-engine to identify the plugin, you’ll need to use some command-line switches,
but first let us play smart, assuming you’ll be updating Chromium somewhere in the future, the application folder will get overwritten so we’re not going to play with files and folders,
lets use the official Adobe plugin!

– download the latest Flash version from the http://labs.adobe.com/downloads/flashplayer.html
I currently developing some video-players with Flash fallback, so I’m using the “+Debugger” version.. but feel free to download the regular one.

its best for you to first download the uninstaller: http://labsdownload.adobe.com/pub/labs/flashruntimes/flashplayer/flashplayer17_uninstall_win.exe
run it to clean the old versions (make all of the browsers are closed, even their background processes, just use task-manager and kill chrome.exe firefox.exe and iexplore.exe if any..)

then the IE version:
http://labsdownload.adobe.com/pub/labs/flashruntimes/flashplayer/flashplayer17_debug_win_ax.exe, and install it.

then the “other” browsers version:
http://labsdownload.adobe.com/pub/labs/flashruntimes/flashplayer/flashplayer17_debug_win_pi.exe, and install it.

and the “other other” browsers version:
http://labsdownload.adobe.com/pub/labs/flashruntimes/flashplayer/flashplayer17_debug_win_ppapi.exe, and install it too.

icompile.eladkarako.com_bring_flash_back_to_chromium_solved__what_to_download

in a second, we will be adding some command-line argument to Chromium, but first we need to find out where are the pepflashplayer{architecture}_version_ver._ver._ver.dll is located, and what is their named:

there are two folders:

C:\Windows\System32\Macromed\Flash\

and

C:\Windows\SysWOW64\Macromed\Flash\

one is holding the x32 version of Flash, and the other is holding the x64 version.
you can visit chrome://chrome/
to see what version you are using, I’m using the x64 version of Chromium for windows..
icompile.eladkarako.com_bring_flash_back_to_chromium_solved__what_is_your_browser_architecture

normally the C:\Windows\System32\Macromed\Flash holds the x32 version and the C:\Windows\SysWOW64\Macromed\Flash\ has the x64 version.

right! so the x64 version it is,

WAIT!!!
Adobe guys had a bug in the installation script, and the DLL FILES location are upside-down:
icompile.eladkarako.com_bring_flash_back_to_chromium_solved__official_adobe_versions_of_pepperflash

ok, so now we’ll be using two switches, one to disable the embedded-plugin (even that it is “not there”) and the other one to force load a flash-plugin from C:\Windows\System32\Macromed\Flash folder.

here is an example for the command line to load Chromium, with Flash support, (again):

C:\Users\Elad\AppData\Local\Chromium\Application\chrome.exe --disable-bundled-ppapi-flash --ppapi-flash-path="C:\Windows\System32\Macromed\Flash\pepflashplayer64_17_0_0_93.dll"

you may put it in a cmd file, or just create a shortcut for chrome.exe and after “OK”‘ing it, just re-edit it adding a --disable-bundled-ppapi-flash --ppapi-flash-path="C:\Windows\System32\Macromed\Flash\pepflashplayer64_17_0_0_93.dll" at the end.

sometimes sending arguments is hard in windows, most of the time there is a lot of inverted commas confusion and mix-ups.

you can download the exe and the ini file from my github page:
https://github.com/eladkarako/iniRun/tree/master/real_world_example

after you’ll run the exe a Chromium process will be created with the arguments passed directly to the Windows-API (so- FAST!) re-open the chrome://flash/ page, and see something like that:

icompile.eladkarako.com_bring_flash_back_to_chromium_solved__flash_loaded_x64bit

enjoy!

JavaScript Beautiful Code Part #2/3 – Proper Coding – Avoiding Implicit Type Conversion

icompile.eladkarako.com_i_always_follow_the_proper_dress_codeMaybe only best used @ the end-point compile-script) to minify/obfuscate your code even more..

point mentioning that those *might* gives you a little street credit, but are considered a really bad practice,
and in no-way you should use those in actual live-code, at least, out of common courtesy for your fellow developers :]

icompile.eladkarako.com_beautiful_code_animation

  • :( x = !!y;
  • :) x = Boolean(y);

  • :( x = +y;
  • :) x = Number(y);

  • :( x = '' + y;
  • :) x = String(y);

  • :( x = ~s.indexOf('.');
  • :) x = s.indexOf('.') !== -1;

consider reading more about:
JSCS (JavaScript Code Style)https://www.npmjs.com/package/jscs
GJSLint (Google JavaScript Linter) https://developers.google.com/closure/utilities/docs/linter_howto

if you see those abominations,
be a pal, and fix it :)

JavaScript Mass Checkboxes Handler

assigning a shift key, one needs to click the first (or any) checkbox, holding the shift key and clicking the next (in a few) will check (on or off) the checkboxes in middle.

the script underneath can be loaded into a .user.js file to be use in Firefox (greasemonkey) or Chrome (also Chromium) Browsers.

// ==UserScript==
// @name           Mass Checkboxes Handler
// @description    Handle Multiple Checkboxes Clicking With Ease. Click The First, Hold [SHIFT] and Click The Last, All Checkboxes That Are In Range Would Be Checked/UnChecked Too. Easy And Fast! Compatible With Chrome and Firefox.
// @namespace      http://icompile.eladkarako.com/
// @homepage       http://icompile.eladkarako.com/
// @include        http://*
// @include        https://*
// @include        file:///*
// @exclude        http://*mail.google*/*
// @exclude        https://*mail.google*/*
// @version        d02.m06.y2010
// ==/UserScript==
window.addEventListener("load", function () {
    function j(a) {
        return a == "html" ? "http://www.w3.org/1999/xhtml" : null
    }

    function g(a) {
        var c = a.target;
        if (c.tagName.toUpperCase() == "INPUT" && c.type == "checkbox" && (a.button == 0 || a.keyCode == 32)) {
            if (a.shiftKey && e) {
                a = e;
                var d, b, f, h = document.evaluate(document.documentElement.namespaceURI ? "//html:input[@type='checkbox']" : "//input[@type='checkbox']", document, j, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
                for (d = 0; b = h.snapshotItem(d); ++d) {
                    if (b == c) {
                        f = a;
                        break
                    }
                    if (b == a) {
                        f = c;
                        break
                    }
                }
                for (; b = h.snapshotItem(d); ++d) {
                    if (b != a && b != c && b.checked != a.checked) {
                        var i = document.createEvent("MouseEvents");
                        i.initEvent("click", true, false);
                        b.dispatchEvent(i)
                    }
                    if (b == f) break
                }
            }
            e = c
        }
    }
    var e = null;
    document.documentElement.addEventListener("keyup", g, true);
    document.documentElement.addEventListener("click", g, true)
}(), false);

//.user.js

Chromium Browser – The Future Of Google Chrome


Chromium is the code-name for Google Chrome development project, the nightly-builds are available for download, and are, mostly, fully functional.

home page for the project.
new builds are available to download here.

I’ve made download script, and a small vb6 program to find the latest version, to make it work you would need those 3 things:
1. wGet.
2. this program: Latest Chromium URL.
3. the following script into a blank CMD (or BAT) file:

@echo off
if exist mini_installer.exe del /f /q mini_installer.exe
setlocal enableextensions
for /f "tokens=*" %%a in ('.\LatestChromiumURL.exe') do (set sURL=%%a)
set sUserAgent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6"
wget --directory-prefix=. --user-agent=%sUserAgent% %sURL%
endlocal
pause

4. put the (1),