chromium browser when opening html file through command line - javascript

When I open a html file via the command line: chromium-browser "file://myhtmlfile.html", the file opens and appears correctly, however, a simple slider control on the page does not behave as expected. (It does not react to touch screen correctly.)
If I then open another tab in the same chromium window, and navigate to the same file and open it in the second tab, it behaves as expected.
When using the dev tools, I don't see any differences. The browser is not loading the file into the browser in the same manner.
Does anyone have a good explanation for this?
Thanks

Related

How to debug a tab in Google Chrome that freezes right from the browser start?

In a vue web application, I have the issue that I have some deep links (example.com/app/some/123) that are handled by the application (vue-router).
Sometimes (not always), for whatever reason when clicking such a link (in Outlook or from a desktop shortcut) when no browser window is opened, Chrome starts but immediately freezes (tab becomes unresponsive).
It feels like there is some redirect loop going on in my application code that causes this freeze. But my issue is that I have no clue on how to debug this to find the spot:
Opening the devtools is possible using the menu but JS files/code does not "load" - Scripts tab stays empty
Clicking the pause button does nothing, the same applies to pressing F8 (pause script execution)
The profiler cannot start (stays at "initializing").
I also have the feeling that this happens when a new version of the app (js bundle) is published but Chrome has some previous version cached. It feels this more often produces the issue. But this is just a guess.
Clicking the pause button/F8 is my regular procedure to tackle such things to find the spot where we are in the JS code at the moment. But unfortunately, here, this does not work as most of the browser is unresponsive.
The only way to close Chrome is to kill it via the task manager.
Is there any way to enable additional logging via Chrome settings or activate an "immediate debug session" right when the browser process starts to somehow get closer to the JS code that freezes the whole tab?
So ideally that somehow, right from the browser start, a profile of the "debug session" is saved even if the browser is process-killed that can later be inspected?
You could try webQsee (https://chrome.google.com/webstore/detail/webqsee-web-sniffer-recor/gamdpfnfkjknkimfbboonmgdfnondfme). The extension provides some usefull export features that might help you identifying the root cause.
Event Snapshot
Exports Screenshot, Cookies, Network and Console output. A lot of info but it is a proprietary format, in can only be analysed in the extension itself.
Excel Export
Like an HAR export, but also including Console output.
These two export options (and more) are available via the export menu located at the bottom of the extension window.

Upload image in chrome extension and extension popup closes

I need to upload image with chrome extension, when file browser is clicked the extension popup closes. How can I handle both the file browser and popup to remain open.
It's a tricky question to answer.
The basic idea is that whenever the popup window loses focus, it is supposed to immediately close, which entails the destruction of the popup's JavaScript context (and your logic breaks as a result). This is not something you can influence.
Modal dialogs such as the file input ought to be an exception, but that doesn't work consistently across all platforms Chrome runs on. Evidence: question, bug.
Whenever you want something to survive popup closing, you normally put it in the background page. This lead to this workaround that places the File input in the background page and triggers its selection from the popup. But there's (unconfirmed) evidence that this does not work anymore. The question above has another, supposedly working answer by injecting the input tag into the current page, but that's subject to failing on "unscriptable" pages such as Chrome Web Store or internal chrome:// pages.
The safest way would be to open a separate tab or popup window to handle the process. This is obviously awkward UX though.
Not sure if you'd actually want to do this, but if you have a small app and it's not a main feat (or you've got high hopes of chrome dev's solving this issue) - as a temp solution you can ask your users to open dev tools while uploading files, popup won't close.
Though you're better off putting your logic into a separate file (eg 'background.html') and opening it from popup as a tab like this:
chrome.tabs.create({url: chrome.extension.getURL('background.html')});

Quickest way to debug Chrome Extension popup scripts

I have the Chrome Apps and Extensions developer tool installed to debug my Chrome Extension. However, to debug the popup script running in the popup window, you have to perform the following steps:
Refresh the Chrome Extension on the Extensions page
Right click the icon next to the url bar
Select "Inspect Popup"
Set breakpoints
The real annoying part about this is the popup window has to be re-opened every time a change happens. Debugging background scripts I don't have as much of a problem with, because the background script debug page stays open after you refresh the chrome extension. But for popup scripts, the popup window along with the popup debug page keeps closing and it becomes a really tedious, repetitive task to re-open it when debugging a lot. Is there no other way to more easily start debugging Chrome Extensions popup scripts?
As i understood you have a pop up while tapping the icon in the URL bar
In order to debug you can use weinre remote debugger ,Which may solve your problem
apache weinre

chrome/firefox- how to run a javascript command

I am using a gwt based ui design framework (called GXT). In the docs for this framework, it is mentioned that running "javascript:isc.showConsole()" when the app is running, will open the developer console in browser.
However when I run this in Chrome it instead does a google search for the command- in firefox it simply does not work.
How do I execute this javascript in firefox or chrome--
javascript:isc.showConsole()
Bookmarklets cannot be executed in the location bar/omnibox any more.
You have to bookmark the javascript: link before it can be executed.
A better solution is using the built-in Developer tools, in which code can be pasted and executed in the current page:
Firefox: Ctrl Shift K - See Using the web console.
Chrome: Ctrl Shift J - See Developer tools.
In Chrome, you add a tab, open bookmarks - click Other Bookmarks, right click in the bookmarks area, click add new page - and paste the URL.
In Firefox, just manage your bookmarks, click on the folder, right click in the bookmarks section and click New Bookmark.
You have to put the command in the URL of the very SmartGWT
application that you're developing, not any blank page.
Making it become a bookmark bar is a good idea, click that bookmark
when you're opening the application will open the console for you.

Opening a WMV file with window.open, in firefox; how can I prevent blank window from opening or close after file downloads?

When you download a file on CNET.com, a message will display on the page to wait a moment and the download will start; if it doesn't, click the link. That's very similar to the page with which I'm working.
The user clicks a link and this page appears with a similar message to CNETs. The only difference is the file is a WMV file and it automatically opens and plays. It works fine in IE. It's not working correctly in Firefox. In Firefox, if the user goes Tools->Options->Applications and selects "Use Windows Media Player" for Windows Media Video File, it plays in the external WMP. If the user uses the WMP plugin, however, the page opens up a blank window and then plays the video in the external WMP.
window.open("test.wmv");
Is there a way to prevent it from opening a window or how can I close the window after the wmv is downloaded and played?
Thank you very much.
Update
I found a link, here, that may be related to this issue. It states that the blank window is a bug with how Firefox handles the WMP plugin, with respect to ASX files. The only difference between the link and my question is one file is of type WMV and the other is of type ASX. The link is dated 2007 and the problem is reported on Firefox 1.5, but perhaps it still has merit. Maybe Mozilla has not addressed this bug, ever (FYI: I'm using Firefox 9.0.1).
I'm starting to think there is no direct solution. I can put a disclaimer, inform the user to turn off the WMP plugin in Firefox. Would a modal window or iFrame be helpful?

Categories

Resources