Mesibo Javascript Popup Integration for one to many chat - javascript

I have integrated Javascript Messenger & Popup https://github.com/mesibo/messenger-javascript/
I want use Popup Integration or Multitab-Popup for more than one user like Javascript Messenger where we can chat with multiple user (one-to-many)
For that I have display list of users on Page and on clicking on user I am loading popup in iframe with destination user mobile no, destination name and logged in user access token from mesibo.
It is working fine for single user while I am loading second user in iframe then first user getting logged out.
Can anyone please help me with this?
Thanks

You should initialize mesibo only once and not every-time you open a new pop-up. The best place for mesibo initialization is when your page loads.
Your popup code should only have send and receive functionalities. If you are using mesibo popup.html example, you should extract initialization and move it to your main page.

Related

Ionic - Open some URL into modal

I'm not sure if this is even possible but, I have a button (Add event to calendar).
This button should let the user create an entry to his Google calendar.
For this, I have to open somewhere this URL
My concern here is that I don't want the user to "quit" the main page (where the button is placed). So opening it in a new tab is not an option.
So I'm wondering if it is possible to open it in ion-modal or anything else that keeps the user with the page.
If your app is based on cordova you can use In App Browser to load a url within the app.
If you are using capacitor you can use Browser Plugin, same purpose.

is there a way to determine if the user is visiting my website via iphone bookmark (add to home screen) in javascript?

i have a dialog in my website's home page that opens if the iphone users are visiting my website for the first time and inside the dialog i'm suggesting users to add my website to their home screen for a quicker access.
i also set a variable to true in cookies that expires within a week for not opening the dialog for the next week if the user visits again.
my problem is that i don't want to show the dialog at all when the user is visiting via the bookmark.
is there a way to do that?
No. I do not think there is a way which can tell you if you were visited by a bookmark or via a browser on the iPhone. You can find out whether the user was an iPhone or Android user, or any OS for that matter.
Once a user clicks a link on their phone, the phone takes them to a browser or opens a "WebView" depending on the link. Even the WebViews might report only the phone type and basic info. when you query for it.
So, basically, No!
you can add one GET when generate url of the marker,
like ?m=1,
to check it from
js with window.location.search

Creating a link to another website and loading a modal

I have just seen a website that can create a link to any website and display a modal when the link is clicked on someone else website. I was just curious if anyone knows how this is done?
Here's the test link that does this:
https://twitter.com/workladuk/status/955752813333766144
Here's how this scheme works:
Notice that clicking on the link in the tweet mentioned in your comment (seen at https://twitter.com/workladuk/status/955752813333766144) doesn't actually take you to StackOverflow, even though it appears to point to this article.
It takes you to http://readr.me/vc-25, a totally different site. This is clear from the browser address bar.
By inspecting the HTML of that page using the browser developer tools, we can see that it actually is a totally different page containing an overlay with the signup form, and also an iframe containing the page the user was hoping to visit, giving the illusion that they're on the page and just need to close the popup to view it. Once they do close the popup, it actually makes a whole new HTTP request and redirects the user to the real page.
Interestingly, this was even more obvious given the example you used, because when going to the site with the signup form, the StackOverflow page displayed underneath it showed I was not signed in, even though I was signed in to SO in other tabs in the browser. This will be because running it in an iframe caused it to be run in a separate session, in which I was not signed in. This was a another big clue to show that I was not on the real Stackoverflow page.
So to be clear, it is absolutely not making a popup appear on another website, because that's impossible without hacking it. Instead it's actually creating another page containing the signup form, redirecting the user to that page and embedding the "real" page within that to create an illusion.

closing issue with modal in modal - bootstrap

I have a customer visits list page, in which add visit invokes a bootstrap popup ("#Pop1") to record visit details. In the modal, I have provision to add new customer (on the fly), which in turn opens another popup ("#Pop2") to capture new customer details.
On successful save of the new customer (via AJAX) I show an alert (browser alert) and close new customer popup using $("#Pop2").hide();. On successful save of visit, I show an alert and close the add visit popup using $("#Pop1").hide();.
I have a couple of issues in this context.
(critical) Pop1 -> Pop2 -> Save -> Save. In this scenario, it returns to the listing page, but the page is not accessible. a transparent layer (that came with Pop1) was still overlay on the page. I need to refresh entire page to add another visit.
When I close the Pop2 using close button, it closes both the popups.
Is there a piece of JS or CSS I need to apply to get this work properly?
instead of $("#Pop2").hide(); use $("#Pop2").modal('hide');
same goes for Pop1 also

Load 2nd web page in background to get content from this web page

I couldn't find anything about this topic, maybe because I'm not a good english speaker and can't find the right words to search for in google therefore.
I'm currently working on an Chrome browser extension which enables me to search for user accounts on a specified web page by using the context menu. Example: If I select the text name123 on any webpage and click the context menu entry, a new tab http://www.webpage.de/user/name123/ is opened.
Now I want to extend the extensions capabilities: I want to search for email addresses, too. For that I can use http://www.webpage.de/search/name123#mail.com/ which brings up a list of all user with the email address name123#mail.com. From there, I could extract the link to the user account as follows:
document.getElementsByClassName("xyz")[0].href
My question: Can I skip the loading of http://www.webpage.de/search/name123#mail.com/ and the "extraction" of the url to the user account? Respectively, can I hide the procedure of opening this additional web page? Does JavaScript support any kind of "preloading" of a webpages content, without being displayed in the browser?
If you can parse the required link from raw HTML, you can fetch the page via an XMLHttpRequest in the background page, examine the result and then open the real profile page.
If the page is dynamic and you need its scripts to run before you can extract the link, you can load it in an iframe in the background page and examine it.
You can do it.
Add permessions to your manifest.json file: 'http://www.webpage.de/*'
Create neccesary ajax requests from background script.

Categories