Posts

Showing posts with the label google-chrome

chrome html5 video stops autoplay after a second or two

Image
Clash Royale CLAN TAG #URR8PPP chrome html5 video stops autoplay after a second or two I've got an autoplaying video which works well on all browsers, except Chrome - which has apparently disabled autoplay video. I've tried some work arounds, but now it just plays for 1-2 seconds and stops entirely. Here's my code: <video id="introduction-video" preload="auto" playsinline autoplay muted loop volume="0" poster="/images/videos/video-background.png" width="100%" height="100%"> <source src="/images/videos/Tasman10seconds.mp4" type="video/mp4"> <source src="/images/videos/Tasman10seconds.webm" type="video/webm"> Sorry, your browser does not support HTML5 video. </video> <script>$(window).on('load',function(){$('#introduction-video').get(0).play();});</script> And you can check i...

Logic for newlines in the Chrome JavaScript console

Image
Clash Royale CLAN TAG #URR8PPP Logic for newlines in the Chrome JavaScript console I'm building my own application that has a JavaScript backend for user scripting, and am implementing something similar to Chrome's JavaScript console. One thing that's puzzling me is the logic that Chrome uses to decide when the return key triggers the command to be executed, and when it auto continues to a new line. For example if you type function blah() { <return> function blah() { <return> then it continues on to the next line to allow you to continue typing the function, whereas function blah() {] <return> function blah() {] <return> immediately gives a parse error (so it's not as simple as just keeping count of open bracket pairs) Does anyone have any hits (or is anyone familiar enough with the Chromium source who's able to point me to that particular logic in their codebase) so it's not as simple as just keeping count o...

How to set value ONLY ONCE in chrome extensions using chrome.storage.local

Image
Clash Royale CLAN TAG #URR8PPP How to set value ONLY ONCE in chrome extensions using chrome.storage.local I am making a Chrome extension that features a login flow using an existing in house authentication system. I make a get query, then the system redirects to the auth URL, then returns the user to a white-listed URL. Right before the user is sent to the authentication URL to do its business, I want to grab their location and store it, so after they are logged in and returned to the white-listed URL, they can then be redirected to where they kicked off the login flow. I am using chrome.storage.local to set location and get location, but due to they async nature of this call, I'm getting an infinite loop. Any suggestions on how to just set and get once and/or hack the async nature of chrome storage? By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy ...

Identify prefetch/prerendering request from Google Chrome

Image
Clash Royale CLAN TAG #URR8PPP Identify prefetch/prerendering request from Google Chrome My problem is identical to that described in this question: Detect Google Chrome page prefetch But there is no appropriate answers. In all sources write that http request must have some special headers, but they are not in fact. For my task this causes serious problems, resulting in duplicate entries in the database. I found solution with Visibility API, but it works only on client side!!!, and I have app with server side rendering and I wont filter prerender/prefetch requests on server side, but they are identical. Anyone ran into this problem? Related link: https://bugs.chromium.org/p/chromium/issues/detail?id=86175 By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Hide warning messages in console window

Image
Hide warning messages in console window The Chrome console window is full of warning messages that I like to hide. Is it possible to hide the warning logs? I only want to show my custom logs e.g. console.log('mymessage'); This is how the console windowbar looks like: Have you tried just using console.error , and changing the level of your log to error ? At least in Chrome, I don't see any way you can hide specific console messages, unless you change the "Level" of the console. Of course, it's not good practice to do this, but if it's just for testing, and you absolutely need the other messages to be hidden, may be worth a shot. – Anish Goyal May 17 '17 at 15:18 console.error error Oh. Based off of that edit, then, you may want t...