How to navigate to different pages in a chrome app without creating a new window? - google-chrome-app

My Chrome app contains two pages A1.html and A2.html. How can i navigate from A1.html to A2.html without creating a new window?
The page A1.html contains 10 div's and A2.html contains a back link to A1.html. My need is to load directly a specific div of A1.html when the back link in A2.html is pressed.

You can't navigate within a Chrome App window (Content Security Policy), although you can navigate to an external browser if you set the target attribute of the <a> element to "_blank". What you have to do, if you really want links to appear to work normally, is intercept the click on the link by setting an event handler and then changing the DOM from within JavaScript.
One easy way to change the DOM from JavaScript if you have an HTML fragment is to use the insertAdjacentHTML API (Google it for documentation).
While this might seem awkward, even limiting, think of a Chrome App as an app, and not a web page. After all, with a native Mac OS X or Windows app, you wouldn't expect to entirely change the UI in a window by simply clicking on a button, right? You'd expect that the app would do that via the native API. Same the Chrome Apps.
Alternatively, you can position a webview in the Chrome App window, and then HTML within the webview works normally, because that really is a "web view."

Related

Default iphone keyboard does not close for entire application if it is opened in iframe in ionic 3

i have used cordova--plugin-ionic-keyboard default plugin in my hybrid ios
application in ionic 3 .
when i open a payment gateway link by using iframe and i click on the textbox button for writing a card details keyboard will appear but if any case i want to go back after opening a keyboard then keyboard is not closed or hide for whole app then i have to close the app and start again.
i have searched a lot of things on internet but i can not get a appropriate answer which works for me.
i have tried out hide() method of plugin but whichever page i use this hide method that page is not open means app stop before the page on which i try hide method.
i also used in-app browser but still not work

Firefox addon SDK - Sidebar or panel with embedded browser

I want to develop a firefox addon sdk to show a sidebar or a panel that contains an embedded browser with a navigation bar.
I have constraint too : Since the page shown in the embedded browser, I want to be able to inspect the dom, to hightlight some specific text and also to be able to select text from and send it to a specific input in sidebar with right menu.
Is there some examples or ideas how can I do this?
P.S : I'm sorry for my bad English ;)
Use sidebar module, create HTML file with a fixed textarea top:0, left:0, width: 100%. Create an iframe that takes up the rest of the sidebar. User enters text into the textarea, then listen for enter keystroke, use regex to see if it's a URL, and set iframe source to the URL if it's a URL or to a Google search if not.
Loading a whole browser into the sidebar seems like overkill, but if you really want to, try to load chrome://browser/content/browser.xul into the sidebar.

Link Target in iPhone Based web app

I am building a web application that is to be run by adding the app to the home screen. Currently it has a list of users, clicking on a user takes you to a detail screen for that user and on that screen is a notes link to take the user to another screen with a grid of notes and a text box to add more notes.
When any links are clicked/tapped, the link is opened in Safari, not the current full screen Safari instance. I tried setting the target of the link to _self, but this had no effect.
Any ideas?
I learned a full screen iPhone webapp can only be a single web page. Any link you try to open will launch Safari instead of replacing the current page. To combat this, I used asp.net postbacks with panels to hide/load/show requested data.
I use target="_webapp" and it works just use for example <a href="http://your.link" target="_webapp"> and it gonna open the link without exit landscape (full screen) i dont know why but with some of my webapps works and sometimes dont.

how do you pop up the Save Image/Open in New Page/Copy menu on command in mobile safari?

I need to find out how to make the menu that appears in mobile safari on the iphone/touch when you tap & hold an element appear on a single tap without having to hold. how would i do this? preferably i would use webkit & no js.
UIWebView does not does not call any methods until a link is actually activated, and it does not expose any information about its subviews. There is no way to do with current SDK, you should file a bug with Apple if you need this functionality.

How are the facebook chat windows implemented?

On Facebook you can browse the site without affecting the floating chat windows. Seems like if the main page was inside an iFrame and the footer and chat windows where floating outside.
(source: k-director.com)
Is the main content inside an iframe or are the footer and chat windows the ones inside an iframe?
The later doesn't seem possible because int this case when you click in a link in the main page everything would have to reload, including the footer iframe.
If you refresh the page the chat windows are reloaded, but if you browse the site by clicking links they are not.
Thank you.
If you install FireBug and enable the net monitor for Facebook, you'll see that when you click most links inside the application, you're not doing a full page refresh, but rather an AJAX call which updates the page with the new content.
It looks like a new page, but in reality you're on the same page with just about everything but the chat-bar replaced.
Probobly just an absolutely positioned div, containing a scrolling div for the content. Ajax would provide the content.
The chat windows do indeed refresh when you load a new page, they maintain their viewstate however (open/close/chat history).
It's an absolutely positioned div, positioned at the bottom of your browser window. It's not hard, I cloned the Facebook chat for ClockingIT from scratch in a weekend.