It would be great to get the firefox extension published to the web store. This would allow easier automatic updating and allow people to find it through that store. So far, however, I have not had any luck getting them to accept it, because the app violates uses eval
and Function
(along with some other things) which are disallowed under the strict CSP policy that is required for a web extension. These violations can be printed by using the lint
command in the web-ext
tool. Most of them originate either from Angular 2 itself or webpack and I have opened an issue in the Angular CLI repo to track resolving them.
Once the the app passes the linter, it is more likely to be accepted by the mozilla team. In that case, we could re-submit it by going to the version page and clicking "Upload a New Version" and changing the hosting to "On this site." The extension is registered under the passit@burkesoftware.com
firefox account.
username-removed-173953 (fff2dc17) at 18 Aug 21:59
increase waiting time so more likely to pass in CI
username-removed-173953 (38fe5e6f) at 18 Aug 21:40
Bump passit sdk verison
I released passit-sdk-js version 0.3.0 and simple-assymetric-js 0.4.0 and that's what passit-frontend uses now.
For the mobile app I need to use the rc version of simple asym (and then hack the passit sdk to use that too).
As far as a I know the rc version is ready to go. We should release it and a new sdk version. Wasn't sure how the changes @saulshanabrook is working on are going and if they can be released too (or already are).
We can discuss Monday.
username-removed-173953 (b662623d) at 18 Aug 18:01
username-removed-173953 (728d3a99) at 16 Aug 20:28
new things
It would be nice to test the extension in Firefox. However, firefox randomly generates the extension URI, so it's hard to figure out how to test it. I also looked into opening up the passit popup, using a keyboard shorcut and running tests on that, but couldn't get that to work on either Chrome or Firefox. On Chrome, it is possible to open up the popup (since this was merged), but it can't be selected through because chrome webdriver limits the windows to those that are type "page" and the popup is type "other". I figured this out by adding logging to the chromedriver, by modifying node_modules/protractor/built/driverProviders/direct.js:71
to let chromeService = new chrome_1.ServiceBuilder(chromeDriverFile).enableVerboseLogging().loggingTo('/tmp/log').build();
and tail
ing /tmp/log
.
Here is some e2e code that attempted to open the popup with a keystroke:
browser.actions().sendKeys(Key.chord(Key.COMMAND, Key.SHIFT, "j")).perform();
EC.browser.wait(() => browser.driver.getAllWindowHandles().then((windows) => {
console.log(windows);
return windows.length > 1;
}), 1000 * 5);
browser.getAllWindowHandles().then((handles) => browser.switchTo().window(handles[1]));
const elem = element(by.css("app-root h2"));
EC.browser.wait(EC.presenceOf(elem), 1000 * 5);
expect<any>((elem).getText()).toEqual("Log in to Passit");
This is some code that creates a firefox profile and adds an extension:
const firefox = require('selenium-webdriver/firefox');
const EXTENSION_DIR = `${__dirname}/dist/`
function firefoxExtensionProfile() {
const p = new firefox.Profile();
// firefox loads extension in the local side, not where selenium is
p.addExtension(EXTENSION_DIR);
p.setPreference('xpinstall.signatures.required', false);
return p;
}
...
{
'browserName': 'firefox',
'firefox_profile': EXTENSION ? firefoxExtensionProfile() : undefined,
}
username-removed-173953 (f24a97d0) at 14 Aug 18:40
include entrypoint
username-removed-173953 (c3293329) at 14 Aug 18:30
fix typo
username-removed-173953 (89becc1e) at 10 Aug 17:58
make function exported so works with aot
username-removed-173953 (a15afd6f) at 10 Aug 17:43
run e2e tests with web ext
username-removed-173953 (c2d9b83b) at 10 Aug 17:41
get ngrx localstorage working again
username-removed-173953 (636786c1) at 09 Aug 21:13
Fix base path for extension
username-removed-173953 (6f1f094b) at 09 Aug 20:23
Run e2e tests on firefox as well in CI
username-removed-173953 (504b3fba) at 07 Aug 21:47
ignore ext failing lint about too big file
The send
now holds everything that is in common between fetch and angular based sending. Now we can just override the sendInner
function, and not have to duplicate logic about getting headers from the class on auth and such.
username-removed-173953 (09112cc2) at 07 Aug 19:58
use published passit-sdk-js version