Log binding context for HTML element when using Aurelia - aurelia

For a site using knockout.js you could select an element in chrome with the picker (dev tools) and then write in the console ko.contextFor($0) is there an eqivalent in Aurelia that would let me see the binding context for an HTML element?

There is a Chrome addon exactly for that (GitHub repo).

Looking at the code from the chrome addon it seems that $0.au gives a decent amount of information.
To get the binding context you can find it with $0.au.show.scope.bindingContext

Related

Integrate kie-tools standalone BPMN editor to my react app

I am trying to integrate the BPMN standalone editor available in the kie-tools repository into my react application.
As an initial way, tried using the <iframe> component in order to integrate. It seemed working well.
But i am unable to customize the download activity as i am not able to get the content by using document.getElementById("bpmn-editor-container").
I have tried out in a chrome browser, disabling the security so that the cross origin issue will not come up.
The editor itself will create an iframe inside the container you provide to the open function. Here is an usage example of the DMN editor (BPMN should be very similar) in a React page. And here is a blog post with a comprehensive description of the parameters you can use to interact with the editor.

Testing a chrome extension using Testcafe with switchToIframe

I've currently got an extension running on testcafe within chrome by having the extension installed on chrome and running: testcafe chrome:userProfile test.js
The content_script in my extension injects an iframe pointing to the web_accessible_resource index.html asset. However when I switch to the iframe context using t.switchToIframe testcafe returns "Content of the iframe to which you are switching did not load"
From what I can see it looks like testcafe-hammerhead isn't rewriting the iframe src when it's in the format of chrome-extension://[PACKAGE ID]/[PATH]) so I've tried changing the url to point to a url i.e. localhost:8080/index.html but this doesn't work either.
If I create an html file inject the iframe using a js file I'm able to get the test to run and interact with the iframe. Therefore I think it's related to how content scripts are run and how they inject content in to the DOM.
Has anyone else run in to this issue/have any better suggestions on how to write tests for extensions in general?
Thanks
Unfortunately, TestCafe doesn't support browser extension testing. TestCafe was designed for cross-browser HTML5 web app testing, so it needs a lot of improvements to cover browser-specific extension APIs.
I suggest you create an issue in the https://github.com/DevExpress/testcafe repository and add +1 to it. If it receives enough votes, we might consider its implementation.

How to get page source for mobile NATIVE (without webviews) app using selenium?

How to get page source for mobile NATIVE (without webviews) app using selenium preferably in javascript?
Depends on your chosen javascript client.
For example, with wd, you would use wd.source(); as can be found from the wd api page: https://github.com/admc/wd/blob/master/doc/api.md
For webdriver-io, the command seems to be client.source();, as found from http://webdriver.io/api/protocol/source.html
If you want to use the selenium-webdriver, it seems that the command would be driver.getPageSource(); as per http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/index_exports_WebDriver.html#getPageSource

Can I use an IFrame to navigate to an external page in a Windows 8 Metro application?

When I currently try I get the following error, even after adding google as a content URI
APPHOST9613: The App Host was unable to navigate to http://www.google.com/ due to the following error: FORBIDFRAMING.
Response from MSFT:
http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/a1cba639-3251-4df8-abd3-b6f6a95ba4ae
You can use Iframe,but you won't get full controll of their JS files,you may have to face some breaking point in such sites, and some sites like google blocking this facility.
Try this,
1. Make your default browser as IE10 which will provide you an App look for IE.
2. trigger an event
function openYourLink() {
var url = new Windows.Foundation.Uri("http://www.google.com")
Windows.System.Launcher.launchUriAsync(url);
}
You can use iframe to navigate to other pages.
<iframe src="http://www.apple.com" />
will do the trick.
However, not every website allows you to put their page in an iframe or they maybe using the top window layer so that their page doesn't support running in an iframe.
In addition, if you are running your code Visual Studio 11 Express, it may throw javascript exceptions in the web page in the iframe. You can "continue" it. This exception will not be visible when you are running a deployed version of your application (running from start menu).
On further investigation the answer seem to be that yes you can for most sites, but some sites (such as google) seem to fail when embedding with an iframe.

what is the equivalent option for displaying a notificationbox in chrome extension like in firefox addon

I am developing extensions for a site for major three browsers (FF,Chrome,IE).
I started with firefox and now working with chrome.
I want to know how to implement an option like the firefox xul notificationbox https://developer.mozilla.org/En/XUL:notificationbox in chrome?
How to display the do you want to save password panel in chrome like in firefox notificationbox?
I inspected LastPass and found that they are injecting a div inside the body tag as the first child of the body tag. is that the way it has to be ? or some other option?
There is an experimental API for this: chrome.experimental.infobars.
Until it gets stable creating your own div is the only option.