history.go(-1) cannot work in IOS14 Beta2 App - history

My web app is working in a WebView of an IOS native application. There is a button on the top-left side of the page, and it will go back to the previous page after the button is clicked. So far so good, but recently many customers have upgraded their IOS to 14 Beta2 and now the back button doesn't work as expected.
I use the history.go(-1) to go back, but if the session history length is 2, it will execute the history.go(-1), but the page will not go back. The url also doesn't change. If the user continue to open new page, then it works again.
Does anyone have ideas of whats going on with it?

I meet the same problem. You can use setTimeout delay for a while when you use history.push,like this
setTimeout(() => {
history.push('xxx');
}, 100);

Related

Show apps on top of the lock screen

I'm building an app using Electron. And I really want to recreate what UWP apps can do. UWP apps can get shown on top of the lock screen. How can I achieve that using Electron/NodeJS?
I tried to do this, but it didn't work:
const mainWindow = electron.remote.getCurrentWindow();
if(isWindows10){
try{
lockSystem();
}catch{
//return an error
}
}
mainWindow.restore();
mainWindow.focus();
mainWindow.setKiosk(true);
And if you're wondering about the fact that UWP apps can get rendered on top of the lock screen, yes they indeed can get rendered on top of the lock screen. You can try to take an exam on exam.net on a windows 10 device, and choose the restricted mode. This will result in chrome opening a pop-up window that asks you to run a UWP app that will lock the device and get rendered on top of the lock screen.
https://www.electronjs.org/docs/tutorial/windows-store-guide - This won't help, as the app doesn't gain access to UWP APIs/features.
EDIT: https://github.com/felixrieseberg/electron-uwp-background - Never mind, it is possible to access those features. But I can't figure out how to do it. Any idea?

Shopify Hamburger Menu Button Not Working On Mobile Devices (Debut Theme)

I'm using the Debut theme on my Shopify site and have an issue with the hamburger menu button not working. It will work once but when I navigate to a new page nothing happens when I press the button again. When the page loads the following message is shown on the console for theme.js:
TypeError: $.debounce is not a function. (In '$.debounce(50, function() {
styleDropdowns($(selectors.siteNavHasDropdown));
positionFullWidthDropdowns();
})', '$.debounce' is undefined)
If I manually empty caches through the browser and reload the page the error no longer appears in the console and the button works again. However, once I navigate away from the page the issue returns.
Any help would be greatly appreciated.
Check to see if you have your JS files included on all pages

How to show users information about extension updates, redirect to a url after update or other methods

In the past, I've seen other extensions be able to redirect you to an info page after the update is completed. I will soon be releasing an update and would like to inform users as soon as the update is completed. Not after they click the icon.
I came across update_info_url which can be placed in the manifest.json however it is unclear if it has been depreciated or not
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/Updates#Update_objects
All other google results date back to 2009.
I'm just trying to figure out how to go about this, i believe I definitely have seen other extensions achieve this.
You can use something like this in the background script:
chrome.runtime.onInstalled.addListener(details => {
if (details.reason == 'update'){
chrome.tabs.create({url:'https://example.com/extensionupdated.html'});
}
});

wait for page load for non-angular Application using protractor

i am new to protractor and testing Non-Angular login Page and on clicking login button on login page a new page appears and i need to click on a planning link.But on clicking Login button application takes around 50 seconds.I want the protractor to wait untill the planning link appears.I used browser.wait(),browser.driver.implicitltyWait() but no success. I am able to click on planning link using browser.sleep() only.
Please help me to resolve the issue.
You need to wait for any WebElement in the page that is loaded after you perform login operation.
var EC = protractor.ExpectedConditions;
browser.wait(EC.visibilityOf(element(by.id("someId"))),60000)
it will wait for the element and throw exception after waiting for 1 minute
So what I understood from your question is that you have a non angular login page and click on login button takes you to another page(Is this angular or non angular?) which takes around 50 sec to load and contains a link(planning). Right?? And clicking on that link will take you to your angular home page.
And the issue which you are facing now is that the protractor is not waiting 50sec for the page containing the planning link to load.
Please try this and let me know the result..
this.clickLoginBtn = function () {
browser.driver.findElement(loginBtn).click();
return browser.wait(function () {
return browser.driver.isElementPresent(planningLink);
}, 50000);
};
I used browser.driver.findElement since we are on the non angular page.
I wrote a blog post about this, and have working examples on github, specifically when testing non-Angular apps. It makes use of Expected Conditions, and Page Objects.
If you're not using Page Objects yet, you'd do something like:
var EC = protractor.ExpectedConditions;
// Waits for the element with id 'loginBtn' to be clickable.
browser.wait(EC.elementToBeClickable($('#loginBtn')), 50000);

Logging out of managed chromebook running in single app kiosk mode

I am a 'Chrome for Business and Education' admin for a fleet of chromebooks which I have configured to run in Single App Kiosk mode. The kiosk app in question is really simple. All I did was take the example code from this page that uses the 'webview tag' (without controls, as we need all the whole screen for the app in question) and change the URL. The app has installed perfectly in all managed devices.
The problem now is that there are times when we want to be able to exit the kiosk app and return to the chromebook login screen. Right now the only way of doing this is to shut the machine down, start it and exit from the kiosk app boot screen by pressing Ctrl+Alt+S. The whole process takes 30 seconds plus per machine (the fleet contains 50). So we really need to be able to just quit out of the kiosk app and go back to the login screen (which would take about 5 seconds or less).
Now, I could just add a quit button to the screen (as per the second example app with navigation controls from the page referenced above) but this means we lose screen space for the app. The preferred solution is to close the app with keystrokes (e.g. Ctrl+Shift+L). But how do you do this in this context? I have tried adding conventional onkeydown javascript to the page containing the webview tag and this seems to be ignored. I have also tried using the 'chrome commands API', and whilst I can see that the shortcut had been registered against the extension (by clicking 'Keyboard shortcuts' on the chrome://extensions tab) it has no effect. The kiosk app window remains stubbornly open.
Does anyone know if this is possible and if so how?
Cheers,
Miles
In your manifest.json file add this entry to create the command for the app.
"commands": {
"exit-app": {
"suggested_key": {
"default": "Ctrl+Shift+L"
},
"description": "Exit the app"
}
}
Then you need to add code to your background script file to listen for the command. This code will close all windows in the app when it receives the exit-app command you created in the manifest.
chrome.commands.onCommand.addListener(function(command) {
switch(command) {
case 'exit-app':
exitApp();
break;
}
});
function exitApp() {
chrome.app.window.getAll().forEach(function(win) {
win.close();
});
}
Note that the key combination is only suggested, and might be ignored if another app or Chrome keyboard shortcut already uses that combination. You do still need to go to the Keyboard shortcuts link on the chrome://extensions page and verify that the key combination has actually been set for your app.

Resources