How to handle failed tabs.create with message 'No current window'? - google-chrome-extension

I need to show a new tab to users when they first install the Chrome extension. If I run tabs.create in the runtime.onInstalled listener, it will sometimes fail with the runtime.lastError.message set to 'No current window'.
I experimentally found out that one of the causes for this is an enterprise policy to force install a Chrome extension.
So, is it possible to detect that the extension was installed with the force enterprise policy? In that case, I would not make the tabs.create call on extension install, or I would first create a window and then create a tab inside it.
Or is there any other way to handle this issue? I am not sure if enterprise force install is the only reason for the 'No current window' failure message.

Related

Will adding 'match_about_blank' trigger a permission warning?

I work on a chrome extension that injects content scripts into all frames on all webpages. I'd like to extend this functionality by adding "match_about_blank": true to the content script permissions in the manifest file. In the chrome extension docs, it says that updating an extension with additional permissions may temporarily disable it. My question is, will adding the match_about_blank attribute to a content script trigger this permission warning?
To close the loop here- the comment by wOxxOm above is indeed correct. I posed this question on the chromium forum and received a full detailed response from a chromium dev here: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-extensions/AnWzbP76ZZs
For anybody else who arrives here wondering if a permission change will cause their extension to be disabled when they push an update, if you follow the instructions here https://developer.chrome.com/extensions/permission_warnings#update_permissions you can actually test this locally (pack and install current build of extension, then make changes and pack and install the extension again using the same private key).

Modify chrome extension for personal use

I would like to modify a chrome extension for personal use. However, I have not been able to install it satisfactorily.
When I use 'load unpacked extension', my browser warns me every time I launch that I am using developer mode extensions. If I pack it and install it, I get the error 'this extension may have been corrupted' and cannot enable it.
I have tried removing the 'key' from the manifest.json and updating the version number, but still get the corruption error. What do I need to do to prevent this error from coming up?
Edit: I tried hosting it on the Chrome Web Store under private visibility, but when I try to install it I get 'An error has occurred: Access denied'.

Installshield Suite Update URL prompt

Currently when i enter the Update URL and that is triggered by the Setup.exe application, the user has no choice but to download the update. There is no prompt to the user as IF they would like to perform the update first or not, they are simply forced to download the update when one is found. My exe is 430MB so i don't want them to be forced to download that if they don't want to. Is there a way to intercept the check and ONLY download/update the exe if the user answers YES to a prompt? I see in the /debuglog file that the URL is checked than immediately starts the download and displays the 'ISDownloadProgress' dialog. But also shows that the 'InstallationWelcome' dialog is shown as well even though it is not. It must be hidden somehow i guess.
The Update URL setting is best suited for a downloading setup launcher which is itself quite small. Since downloading setup launchers can be invalidated if the resources they fetch are moved or removed, it doesn't let the user choose whether to get the updated launcher.
Since this behavior is not currently optional, you could file an enhancement request with the support team, or you could write a wrapper that performs a similar check.

With Casper.js, is it possible to accept browser permission prompts?

I'm hoping to test WebRTC functionality in my web app. This requires accepting the browser's permission prompt for access to the Camera and/or Microphone. Is this possible to do with Casper.js and Slimer.js? I can't find anything in the documentation suggesting it's doable.
Somewhat related (similar problem, different platform): Accept browser permission dialog with behat/mink
While you can't programmatically click the permission button, CasperJS/SlimerJS will let you use a custom profile for the automated Firefox instance you're using in your tests. At least in the case of the WebRTC/getUserMedia permission prompts, Firefox lets you disable them in a profile's settings.
Here's what you do. In your shell, use SlimerJS to create a new profile:
slimerjs --createprofile nameOfYourNewProfileGoesHere
Your new profile has been created in your Firefox profiles directory. To locate the directory you can either search for the profile name you just created, or go to Firefox and Help Menu > Troubleshooting Information. Next to 'Profile Folder' click 'Show in Finder' (or equivalent for your platform).
Your profile is a directory with a name like asfd1234.nameOfYourNewProfileGoesHere, inside that dir edit the prefs.js file and add this line:
user_pref("media.navigator.permission.disabled", true);
Now when you run your CasperJS scripts (or SlimerJS directly, I suppose -- I only tested this through Casper), you just need to specify the profile. With CasperJS:
casperjs test --engine=slimerjs -P nameOfYourNewProfileGoesHere nameOfYourTestFile.js
It's almost too easy! ;)

Suppress message box during silent install of installshield basic msi, but allow it during visual install

I created a basic stand-alone msi file using InstallShield 2012. There is a prerequisite that needs to be fulfilled before installation begins. To check this prerequisite, I created an InstallScript-based custom action and added to the very first position in Sequences. If the check fails, the msi should display an error message and then quit. Because the msi will be run both directly via double-clicking and silently via msiexec, the error message should be smart enough to launch a message box during direct install (UI is available) and suppress any message box during silent install (I use "SpretfMsiLog" to write the error message into msi log file).
I tried to run silent install using "msiexec /qn" but the message box still showed up. Is there a way to detect the install mode from with InstallScript code and therefore hide/show the message box accordingly?
The proper approach for this involves using MsiProcessMessage to show the message, as it can parent the window correctly and already knows when not to show it at all. However if you're looking for the minimal changes to what you already have, it's possible that checking the UILevel property will be easier to implement.
An alternative to checking UILevel, would be to check the mode.
if (MODE == SILENTMODE) then
...
endif;
Description: http://helpnet.installshield.com/installshield18helplib/mergedProjects/installshield18langref/LangrefMODE.htm

Resources