Enable Firefox DevTools on new opened tabs by default (if they were enabled before) - mozilla

Earlier, when I was using Firebug and opened new tab - Firebug was already activated there. Now, in Firefox 51.0.1, I need to press F12 every time to open the Firefox DevTools. How can I activate them by default for new tabs?
The allPagesActivation option in about:config doesn't help.

Firebug's activation model is URL based following the same origin policy, by default. It can be changed to be always on via the extensions.firebug.allPagesActivation property, as you already noted.
The DevTools' activation model, though, is tab based and there is no option yet to change that (as of Firefox 51.0.1). Though this is already requested in bug 1284012.

Related

Where is the data stored in the `background` of the chrome extension? [duplicate]

Chrome DevTools has a handy inspector for Local Storage and Session Storage, but is there nothing to inspect chrome.storage.sync?
chrome://sync-internals/ doesn't seem to display the actual contents of the synchronized storage per extension.
Storage Area Explorer extension provides a UI for viewing, editing, clearing, importing and exporting of chrome.storage.local, chrome.storage.sync, localStorage and sessionStorage.
In the future this feature may be implemented natively: https://crbug.com/848752.
Warning for ManifestV3: since devtools for service worker doesn't show storage, you'll have to open any visible page of your extension like the popup or options, right-click the page, then click "inspect", then go to Storage Explorer. If your extension doesn't have any visible pages, you can open chrome-extension://ID/manifest.json where ID is the id of the extension as shown in chrome://extensions page. Another method is to right-click any script from your extension in devtools (when you inspect the content script or service worker), then click "Open in a new tab". You can add a bookmark for this tab to open it quickly next time.
Visit chrome://sync-internals/
Click Sync Node Browser tab and wait for it to load (may give a blank screen or in progress cursor)
Click expansion triangle in the sidebar for Extension settings
Click on individual settings in the sidebar to see their values and other metadata
A poor workaround is to call get and obtain all the stored values. Of course, this doesn't let you conveniently edit them:
chrome.storage.sync.get(null, function callback(items) { console.log(items) });

Browser extension: Can I view the string I set with chrome.storage.sync.set for my extension? [duplicate]

Chrome DevTools has a handy inspector for Local Storage and Session Storage, but is there nothing to inspect chrome.storage.sync?
chrome://sync-internals/ doesn't seem to display the actual contents of the synchronized storage per extension.
Storage Area Explorer extension provides a UI for viewing, editing, clearing, importing and exporting of chrome.storage.local, chrome.storage.sync, localStorage and sessionStorage.
In the future this feature may be implemented natively: https://crbug.com/848752.
Warning for ManifestV3: since devtools for service worker doesn't show storage, you'll have to open any visible page of your extension like the popup or options, right-click the page, then click "inspect", then go to Storage Explorer. If your extension doesn't have any visible pages, you can open chrome-extension://ID/manifest.json where ID is the id of the extension as shown in chrome://extensions page. Another method is to right-click any script from your extension in devtools (when you inspect the content script or service worker), then click "Open in a new tab". You can add a bookmark for this tab to open it quickly next time.
Visit chrome://sync-internals/
Click Sync Node Browser tab and wait for it to load (may give a blank screen or in progress cursor)
Click expansion triangle in the sidebar for Extension settings
Click on individual settings in the sidebar to see their values and other metadata
A poor workaround is to call get and obtain all the stored values. Of course, this doesn't let you conveniently edit them:
chrome.storage.sync.get(null, function callback(items) { console.log(items) });

Selenium VBA chrome cannot open website after setting default profile with . SetProfile

I want to get data from a website where I need to log in. If I open the website manually via Chrome, I can log in with my user name and password. If I do the same with chrome via selenium vba, the website requires an extra authentication step that I cannot automate. So I have tried to add profile information to the driver with ".SetProfile". There is a default profile and 5 other profiles in ".../UserData", but none of the latter is my standard profile. So I opted for the default profile. Doing this, Chrome asks me to choose one of the available profiles. After choosing the desired profile (my standard profile, which has already a window open), the script should open the log-in page, but nothing happens. No error message, no new tab or window opening, nothing. I can get to this point by debugging step by step, but after this step, I lose control, cannot do any further steps.
As long as I do not include the ".SetProfile" step, the script works fine, with the mentioned limitation that the website then requires a 2-step authentication.
Sub CheckThis(Target, Cancel)
......
With chrome
.SetProfile "C:\Users\username\AppData\Local\Google\Chrome\User Data", True
.Start 'here, Chrome asks me to choose a profile and then nothing else happens anymore
.Get "website.com"
Set user_email = .FindElementById("login-email")
user_email.SendKeys ("userName")
Set siguiente = .FindElementById("login-submit")
siguiente.Click
Set Password = .FindElementById("login-password")
Password.SendKeys ("Password")
Set iniciar = .FindElementById("login-submit")
iniciar.Click
(the rest is irrelevant for the issue)
I think I understand now why it does not work and why it probably cannot work.
This is what I tried:
I closed the existing open Chrome window with all its tabs before running the script. After the ".SetProfile" line, Chrome asked me again, which profile I want to use. When I chose my standard profile, the Chrome Window that I had just closed, opened again, but the desired webpage did not open.
Then I tried again, this time running the script until ".Start" without the ".SetProfile". This opened an empty Chrome window without any profile, as expected. Then I tried to log in to this instance of Chrome manually with my usual profile. The log-in was rejected after entering my username. Checking the error info, I found that, among others, Google does not allow logging in if the browser is not controlled by a person but by an automatization software which, of course, is the case when I open Chrome from Selenium.
This means, there seems to be no solution for my problem. Without logging in to my Chrome profile, the web page will always require 2-step authentication, and logging in to a Chrome profile is not possible if Chrome is controlled by VBA.

Can Chrome Extension’s new options_ui trigger a page action?

I’ve been placing a page action on the options page of my Chrome extension. options.js calls chrome.runtime.connect({"name":"someName"}), and background.js has
chrome.runtime.onConnect.addListener(function(port) {
chrome.pageAction.show(port.sender.tab.id);
});
Unfortunately, in the new options_ui with the recommended default (and someday mandatory) "open_in_tab":false, the Sender's tab won't be set. Is there a way to get the tab id in order to show the page action?
I could use tabs.query to get the chrome://extensions/ tab, but that requires the tabs permission, which I currently don’t need. Active tab seems like it would work, but it doesn’t provide the tab id and isn’t enabled by opening an option dialog (source).
(Why do I want the page action on my options page? The extension works with a website that is only available ~7-10 weeks per year. I’d like my users to be able to interact with the extension the rest of the time, so that they can get used to the process. But I don’t want to adjust the displayed extension permissions just to do so. I can accomplish this by having the options page pretend to be the website in question.)

Chrome extension occasionally crashing - why?

I am developing an extension which uses the tab API, long-lived connections and HTML5 indexedDB. The extension crashes randomly (or at least I cannot reproduce a crash scenario). I took a look the the chrome log:
[22654:-1322192896:0118/184514:VERBOSE1:ipc_sync_channel.cc(382)] Canceling pending sends
[22649:-1398687192:0118/184514:VERBOSE1:speech_input_extension_manager.cc(228)] Extension unloaded. Requesting to enforce stop...
[22654:-1398687192:0118/184514:VERBOSE1:ipc_sync_channel.cc(382)] Canceling pending sends
[22654:-1322192896:0118/184514:VERBOSE1:ipc_sync_channel.cc(382)] Canceling pending sends
[22808:-1398687192:0118/184514:VERBOSE1:chrome_v8_context.cc(125)] Could not execute chrome hidden method: Port.dispatchOnDisconnect
[22808:-1398687192:0118/184514:VERBOSE1:chrome_v8_context.cc(125)] Could not execute chrome hidden method: Port.dispatchOnDisconnect
[22808:-1398687192:0118/184514:VERBOSE1:chrome_v8_context.cc(125)] Could not execute chrome hidden method: Port.dispatchOnDisconnect
[22808:-1398687192:0118/184514:VERBOSE1:chrome_v8_context.cc(125)] Could not execute chrome hidden method: Port.dispatchOnDisconnect
[22808:-1398687192:0118/184514:VERBOSE1:chrome_v8_context.cc(125)] Could not execute chrome hidden method: Port.dispatchOnDisconnect
[22808:-1398687192:0118/184514:VERBOSE1:chrome_v8_context.cc(125)] Could not execute chrome hidden method: Port.dispatchOnDisconnect
[22649:-1398687192:0118/184514:VERBOSE1:notification_ui_manager_impl.cc(83)] Added notification. URL: data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%0A%3Chtml%3E%0A%3Chead%3E%0A%20%20%3Ctitle%3E%3C%2Ftitle%3E%0A%20%20%3Cstyle%3E%0A%20%20body%20%7B%0A%20%20%20%20direction%3A%20ltr%3B%0A%20%20%7D%0A%20%20%23icon%20%7B%0A%20%20%20%20height%3A%2032px%3B%0A%20%20%20%20width%3A%2032px%3B%0A%20%20%20%20float%3A%20left%3B%0A%20%20%7D%0A%20%20%23title%20%7B%0A%20%20%20%20margin-left%3A%2038px%3B%0A%20%20%20%20font-weight%3A%20bold%3B%0A%20%20%20%20font-size%3A%2013px%3B%0A%20%20%20%20font-family%3A%20helvetica%2C%20arial%2C%20sans-serif%3B%0A%20%20%7D%0A%20%20%23description%20%7B%0A%20%20%20%20margin-left%3A%2038px%3B%0A%20%20%20%20font-family%3A%20helvetica%2C%20arial%2C%20sans-serif%3B%0A%20%20%20%20font-size%3A%2013px%3B%0A%20%20%7D%0A%20%20%3C%2Fstyle%3E%0A%3C%2Fhead%3E%0A%3Cbody%3E%0A%20%20%3Cdiv%20id%3D%22icon%22%3E%3Cimg%20src%3D%22chrome-extension%3A%2F%2Fegoecnhkgdfeofmdmjgopmdjbaknldjf%2Fres%2Ficon_48x48.png%22%20width%3D%2232%22%20height%3D%2232%22%3E%3C%2Fdiv%3E%0A%20%20%3Cdiv%20id%3D%22title%22%3E%3C%2Fdiv%3E%0A%20%20%3Cdiv%20id%3D%22description%22%3EHelloWorld%20ist%20abgest%C3%BCrzt.%20Klicken%20Sie%20auf%20dieses%20Fenster%2C%20um%20die%20Erweiterung%20erneut%20zu%20laden.%3C%2Fdiv%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E%0A
I activated the most chatty verbose mode but it doesn't make sense to me what causes the crash. Any suggestions?
You should submit a ticket to the Chromium Project http://code.google.com/p/chromium/issues/list and someone from Google will respond back to you in couple days.
I had a similar problem it took me a full day to solve, I think it may apply. My popup extension would run without crashing if I simply opened it, however if I opened the extension in developer mode (ie right click -> 'Inspect Popup') the next time I'd try to open it would crash.
This appears to be a problem with Chrome's new Device Mode feature. To fix this, I had to open my popup.html file in a new tab, and make sure Device Mode was OFF. Then, when I opened my extension in developer mode, it would not crash anymore.
To turn off Device Mode:
Open your html file in a new tab
Enter developer mode (View -> Developer -> Javascript Console)
Ensure that device mode is off (Device mode is toggled by clicking the small image of a mobile phone that is beside the magnifying glass)
Hope this helps one of you.

Resources