Posts

Showing posts with the label Google Chrome

Can We Do Web Push Notifications In Chrome Without Using GCM/FCM?

Answer : No, it is not possible to use another push service. In Firefox, you can do it by modifying the dom.push.serverURL preference, but obviously you'd need privileged access to alter the value of the pref. There are third-party services that you can use to implement push notifications, but they will use the Web Push API under the hood (so Autopush on Firefox, GCM/FCM on Chrome). Yes. Using VAPID spec and service worker you can use web push notifications without FCM/GCM. For more information please look into below google docs. https://developers.google.com/web/fundamentals/engage-and-retain/push-notifications/how-push-works

400x Sorting Speedup By Switching A.localeCompare(b) To (ab?1:0))

Answer : A great performance improvement can be obtained by declaring the collator object beforehand and using it's compare method. EG: const collator = new Intl.Collator('en', { numeric: true, sensitivity: 'base' }); arrayOfObjects.sort((a, b) => { return collator.compare(a.name, b.name); }); Here's a benchmark script comparing the 3 methods: const arr = []; for (let i = 0; i < 2000; i++) { arr.push(`test-${Math.random()}`); } const arr1 = arr.slice(); const arr2 = arr.slice(); const arr3 = arr.slice(); console.time('#1 - localeCompare'); arr1.sort((a, b) => a.localeCompare( b, undefined, { numeric: true, sensitivity: 'base' } )); console.timeEnd('#1 - localeCompare'); console.time('#2 - collator'); const collator = new Intl.Collator('en', { numeric: true, sensitivity: 'base' }); arr2.sort((a, b) => collator.compare(a, b)); console.timeEnd('#2 - collator'); con...

CSS Table And Max-width In Chrome Not Working

Answer : Technically Chrome is following the rules because max-width should only apply to block elements . From MSDN docs: The min-width/max-width attributes apply to floating and absolutely positioned block and inline-block elements, as well as some intrinsic controls. They do not apply to non-replaced inline elements, such as table rows and row/column groups. (A "replaced" element has intrinsic dimensions, such as an img or textArea.) The table (or in your case display:table) should technically not work or be supported. FF apparently obeys it fine, but you'll probably need to come up with another solution, either removing the display:table or the max-width . max-width property MSDN Doc The solution I found was using table-layout: fixed and width: 100% Create a div and give it a styling to display block and a max width. You may use traditional <table> and give it a styling of 100% width.

Copying Code From Inspect Element In Google Chrome

Answer : Right click on the particular element (e.g. div , table , td ) and select the copy as html . In earlier versions of Chrome we could simply select and copy an element (with Ctrl+C or Cmd+C) and then paste it inside an element by selecting it and then paste (with Ctrl+V or Cmd+V). It's not possible in the latest versions though (I'm running Chrome 58.0.3029.110) and it has set me up many times since then. Instead of using the commands for copy and paste, we now have to right click the element -> Copy -> Copy Element and then right click the element that we want to append the copied element to -> Copy -> Paste Element. I don't understand why the short commands are deactivated but at least it's still possible to do it in a more inconvenient way. Click on the line or element you want to copy. Copy to clipboard. Paste. The only tricky thing is if you click on a line, you get everything that line includes if it was folded. For example if you click on a ...

Anaconda Selenium And Chrome

Answer : The easiest would be to install chrome-driver via anaconda (especially when running on a machine where you don't have permissions to install chrome-driver from .deb package) conda install -c conda-forge python-chromedriver-binary (updated based on comment from bgoodr (https://stackoverflow.com/users/257924/bgoodr) - please vote his comment below ). The simplest solution is to install chromedriver as suggested by @bgodr: conda install -c conda-forge python-chromedriver-binary Then at the top of your code, add the following import statement to update your PATH variable appropriately: import chromedriver_binary Download latest chromedriver Update Chrome itself In your code from selenium import webdriver driver_path = '/path to chromedriver.exe/' driver = webdriver.Chrome(driver_path) driver.get('somewebsite')

Can I Create A New Session In Another Tab Or Window In Google Chrome?

Answer : Currently, this is not possible. You can use multiple profiles in Google Chrome, though. Read the instructions here. Enable multiple accounts: https://www.google.com/accounts/MultipleSessions Then, create a bookmark(let) or a keyboard shortcut for each mailbox: https://mail.google.com/mail/u/0/#inbox https://mail.google.com/mail/u/1/#inbox Source: http://lifehacker.com/5733636/switch-between-multiple-gmail-accounts-with-a-url-hack MultiLogin is down from the google webstore, but there is an alternative (SessionBox) https://chrome.google.com/webstore/detail/sessionbox-beta/megbklhjamjbcafknkgmokldgolkdfig

Can't See My Device Of Chrome://inspect/#devices

Answer : Try these steps: Download and install Android SDK Open SDK Manager.exe Select Android SDK Platform-tools and press Install packages... Open a command prompt and execute these commands: cd C:\Program Files(x86)\Android\android-sdk\platform-tools (or C:\Users\User\AppData\Local\Android\Sdk\platform-tools ) adb.exe devices You should receive a response like this: List of devices attached ABCDEFG123 device If your device is listed check if Chrome detect the device, otherwise try to execute this command: adb.exe kill-server adb.exe start-server adb.exe devices Check again if Chrome detect the device. If your device is not listed at all after executing adb devices command there is something wrong in your configuration (e.g. incorrect or missing drivers?) Hope this helps somebody else... This happened to me because I was trying to Chrome inspect a release build (Ionic; i.e. ionic build android --release ). If I build a debug app ( ionic build andr...

Browser Says "Camera Blocked To Protect Your Privacy"

Answer : type url chrome://flags/#unsafely-treat-insecure-origin-as-secure Enter url in the textarea Choose Enabled in the select option Click image link bellow to see detail example Chrome blocks vulnerable features—including camera, location, microphone, etc. on non-secure sites. As of July 2018, with the release of Chrome 68, Chrome starts to mark all HTTP sites as "not secure." You have three options to unblock these features for your site: Treat 192.168.10.79 as secure origins by setting chrome://flags/#unsafely-treat-insecure-origin-as-secure . Origins must have their protocol specified, e.g., http://192.168.10.79 . Port forwarding your site address to localhost . Chrome treats localhost as secure origins. Set up a self-signed certificate for the server.