w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Sending message from popup.js in Chrome extension to background.js
Just to clarify, we talking about communication between popup page from browserAction and background script? Anyway you have quite a few errors in your code. First your totally ignore the fact that all callbacks in chrome api are asynchronous. In background page var tabURL = "Not set yet"; chrome.tabs.getCurrent(function(tab){ tabURL = tab.url; }); //this will be invoked somewhere in the future sendResponse( {navURL:tabURL} ); //navUrl will be always Not set yet because callback of getCurrent hasn't been called yet Same in popup.js chrome.extension.sendMessage({greeting: "GetURL"}, function(response) { tabURL = response.navURL });//callback will be invoked somewhere in the future $("#tabURL").text(tabURL)//tabURL will display something tota

Categories : Google Chrome

Message Passing between Chrome Extension and Content Script
If you check the injected page's console, you should see something like TypeError: Converting circular structure to JSON This is because you are trying to pass an HTML object through JSON. Try passing just the ID of the button instead and see if it works then.

Categories : Google Chrome

How can I send a Twitter direct message from a Google Chrome extension?
Twitter REST API v1.1 requires authentication There are a list of useful libraries here you can use And this is a really useful Twitter proxy script, just replace the tokens and access keys with those of your application's and route all requests to it - however I haven't used this for POST requests

Categories : Javascript

Chrome Extension: Send Message from Background to Injected Script
Before I continue, I'd like to point out that you're just dealing with an ordinary content script, not an "injected script" (according to my definition). Don't send the response at the first request (sendResponse({})). Instead, call sendResponse when the response has been finished: // Content script chrome.runtime.sendMessage({method: "getResultForRequest"}, function(response) { }); // Background page chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { if (request.method == "getResultForRequest") { $.ajax({success: sendResponse}); // Example return true; } }); As said at the top of this answer, what you're dealing with is not an injected script, but a content script. The script execution environment of the content script and the page

Categories : Javascript

Chrome extension: can't get message passing to work between background script and content script
From onMessage documentation. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until sendResponse is called). So your code should look like chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { console.log(sender.tab ? "from a content script:" + sender.tab.url : "from the extension"); if (request.greeting == "hello") { sendResponse({farewell: "goodbye"}); return true; } });

Categories : Javascript

Chrome extension : error when sending message back from injected script to background script
I think my issue was fixed by chrome.tabs.sendMessage(tabId, {action: 'test'}, Note, I incorrectly use msg instead of action in above question. Also, I do not use the third parameter sendResponse to avoid full-duplex communication I simply post another message from content script back to background page. From content script, send message to background page using: function SendMessageToBackgroundPage(data) { chrome.runtime.sendMessage({ action: 'kungfu', source: 'panda' }); } Catch it inside background page using: chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { switch (request.action) { case 'kungfu': alert(request.source); } });

Categories : Javascript

Get GMail's "To" Field in a Chrome Extension
Gmail's to Field doesn't work like a textarea, It takes the email from text and creates a div for each email before the text area. You should inspect DOM to see what is going on there. Here is the related part of code. <div class="vR"> <span class="vN vQ" email="email1@example.com"> <div class="vT">email1</div> <div class="vM"></div> </span> <input name="to" type="hidden" value="email1"> </div> <div class="vR"> <span class="vN vQ" email="email2@example.com"> <div class="vT">email2</div> <div class="vM"></div> </span> <input name="to" type="hidden" value="email2"> </div> <textarea rows="1" id=":2y" class="vO" name="to" spellcheck="false" autocomplete=

Categories : Javascript

Chrome extension: How to manipulate inner Gmail DOM with jQuery?
The DOMReady event fires long before your target element is created. When you go to mail.google.com you'll notice the loading bar - just before that appears your event is fired. I'm not sure if GMail has any custom events that are more reliable, otherwise I'd suggest using jQuery(window).load(function(){ jQuery("div.gK").css("color", "red"); }); If you feel like dissecting the events in more detail I suggest reading up on and using the Chrome Developer Tools, with a focus on the Timeline tab.

Categories : Jquery

Java - sending a message to WebSphere message broker and its altering my message
How are you reading the message after it is received? are using readUTF method? If you have used writeUTF while sending a message, then you must use readUTF method retrieve the message body after receive. The "n" could actually be the length of the XML message as, in UTF string, the first two bytes indicate the length of the string that follows.

Categories : Java

Adding text to GMail message before forward
If I do a "forward" in GMail I do have not only the possibility to add text but the orignal message is prepended with ---------- Forwarded message ---------- From: <amsmota.dev@gmail.com> Date: 19 July 2013 11:00 Subject: Fwd: BETA TEST To: I would like to do the exact same thing, should I open a request for this? It seems such a trivial thing to do that it strikes me why it's not done yet, maybe I'm overseeing something? Cheers.

Categories : Google Apps Script

imapX marking a message as read in Gmail?
First of all, if you're using the old ImapX library, I invite you to upgrade to ImapX 2. It's being constantly developed and supported. There is also sample code for all common operations. The Process method of a message doesn't mark the message as read, it only downloads the whole message including attachments. In your case, if you call the Search method setting the second parameter to true, you don't have to call it for every single message. To mark a message as read simply use the AddFlag method of Message: ImapX.Collections.FolderCollection folders = imapclient.Folders; ImapX.Collections.MessageCollection messages = imapclient.Folders["INBOX"].Search("UNSEEN", true); foreach (var mess in messages) { mess.AddFlag(ImapX.Flags.MessageFlags.Seen); }

Categories : C#

Using imap_open() to get gmail account message [getting error]
There could be a number of errors here that are leading up to the root cause of the failure. In this case, imap_last_error might not return any useful information. A suggestion I saw noted on the imap_open page of the PHP manual is to trace through imap_errors instead, as this will give you all the errors that have occurred since the request has started. This seems to be a common issue particularly with gmail, where denied access might not be directly due to imap (an unverified account, for example). Try this instead: $inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Friggin Server: ' . print_r(imap_errors())); Might yield more information as to why your connection is failing. See: http://php.net/manual/en/function.imap-open.php#103762 http://php.net/manual

Categories : PHP

How mark gmail message as unread (unseen) MailSystem.NET
using library http://mailsystem.codeplex.com/ Source: http://mailsystem.codeplex.com/discussions/269058 add reference: activeup.net.common, activeup.net.imap4, activeup.net.mail code: Imap4Client imap = new Imap4Client(); imap.ConnectSsl("imap.gmail.com", 993); imap.Login("aaaaa@gmail.com", "xxxxxxx"); imap.Command("capability"); Mailbox inbox = imap.SelectMailbox("inbox"); int[] ids = inbox.Search("UNSEEN"); if (ids.Length > 0) { ActiveUp.Net.Mail.Message msg_first = inbox.Fetch.MessageObject(ids[0]); //ignore this gmail_data stuff // undefined in this scope // checking to make sure it's a "new" unread msg //if (gmail_data != msg_first.Date.ToString()) //{

Categories : C#

Can't receive extension from message
As this thread explains (http://stackoverflow.com/a/11141819/474002): Timestamp is not part of the regular messages. Therefore you cannot extract it. I think you could send a custom packet (use PacketExtension) to extend your message packet to include the timestamp information. Message message = new Message(); DefaultPacketExtension yourExt = new DefaultPacketExtension("your_ext", "com:your:ext"); yourExt.setValue("timestamp", YOUR_TIMESTAMP); messgae.addExtension(yourExt);

Categories : Android

Get selected message data in Thunderbird extension
This documentation looks fairly outdated. I would suggest: using gFolderDisplay.selectedMessage (try typing top.opener.gFolderDisplay.selectedMessage in the Error Console), reading some recent code that uses Services and MailServices so as to simplify your code. That being said, I don't know what you're trying to achieve but: you'd certainly be better off using a wrapper such as MsgHdrToMimeMessage (self-reference: http://blog.xulforum.org/index.php?post/2011/01/03/An-overview-of-Thunderbird-Conversations) if you absolutely, absolutely need to get the raw contents of the message, http://mxr.mozilla.org/comm-central/source/mailnews/db/gloda/modules/mimemsg.js#223 has an example on how to do that (it's the implementation of the said MsgHdrToMimeMessage; by simplifying it, you should be

Categories : Javascript

How to Pick up Link(URL) using a Google Chrome Extension
If you are looking to pick up the URL of the page on which you are currently before pressing the extension button/icon. Use the following code. chrome.tabs.query({ "active": true,//fetch active tabs "currentWindow": true,//fetch tabs in current window "status": "complete",//fetch completely loaded windows "windowType": "normal"//fetch normal windows }, function (tabs) { for (tab in tabs) { console.log(tabs[tab].url);// Use this URL as needed } }); it can eliminate above effort. P.S: var elem = document.getElementById("myinputbox"); the above code will never work in background page because of missing element.

Categories : Javascript

PHP Error message in Firefox not Chrome
Uninitialized string you get because your variable is not setted in an array. Make sure that is setted. if (isset($somevar['var'])) { // etc.. } Your session_start() code is NOT on your TOP in a PHP file. A session_start() should be called before all scripts executed. To turn off showing errors manually via PHP put on top: ini_set("display_errors", 0); Put all your errors to error.log file instead of showing errors on PHP production environment. X-Pad is header appender to the response from apache. So this isn't way what errors occured. X-Pad doesn't relation with your errors.

Categories : PHP

Message queue with GLIB {issue in receiving message back after posting}
There's an awful lot of copy/paste of the GQueue API, mixed with some new functions using a "channel" parameter, but named the same way as real GQueue functions, which is a terrible idea. Finally, it seems the error is at the very end of the block of code you gave us. You call PendMessageQ, but you have posted no data in that queue. Hence, you try to get pop a value from that queue, but only get a NULL pointer, which you try to copy. And you get a segmentation fault in the memcpy for that. Next time, use a debugger to find that out, and please provide a code that compiles, which was not the case here.

Categories : C

Vim print diagnostic message into message buffer AND prevent "press Enter to continue" prompt
Well, this is cool. I looked at this documentation: :echo-redraw A later redraw may make the message disappear again. And since Vim mostly postpones redrawing until it's finished with a sequence of commands this happens quite often. To avoid that a command from before the ":echo" causes a redraw afterwards (redraws are often postponed until you type something), force a redraw with the :redraw command. Example: :new | redraw | echo "there is a new window" The undesired prompting is really Vim trying to be nice, so if we just tell it what we want, everyone's happy! Applied it to the plugin (redraw | echom ...) and it works a charm.

Categories : Vim

Extract link from IMAP message
Some bugs in the code above: Using 1.2 as a floating point number instead of a string. It's a string and it's only sheer luck that your 1.2 is not getting converted as 1.2000000001. Having a hardcoded part number in case the mail comes with multiple body parts -- read the description in RFC 3501, p. 56 for details on what these body parts are, how they work and how to find out which ones are relevant for you Not performing any decoding of the Content-Transfer-Encoding or dealing with character set conversions. You are apparently interested in text parts of a message, these can arrive in multiple encodings like quoted-printable or base64 which you will have to decode. If you'd like to play it safe (you should, it's 2013 already and there are funny characters in URLs, not speaking about th

Categories : PHP

Showing message from "return json(message)" of action in previous jquery dialog after posting its form
You need to use preventDefault first inside the click handler, otherwise the default action (submitting the form) will proceed. $("#SubmitButton").click(function (e) { e.preventDefault();

Categories : Javascript

UIAutomation - Check the message in Alert and compare it with expected message
You're so close! You've got the parentheses and brackets backward in your line. Do it this way: target.frontMostApp().alert().staticTexts()[1].value(); That way, you are calling the staticTexts() method on the alert to get the element array and then using the bracket syntax to get the second element.

Categories : IOS

SMS Message with multiple recipients - Android message sending limit
Multiple recipients count as multiple SMS messages and will add to your quota. Basically you dispatch a message for each recipient, and this discussion suggests that this limit seems to be imposed the SMSDispatcher.

Categories : Android

Spring form binding - use IllegalArgumentException message as error message
You might want to check BindingErrorProcessor used by WebDataBinder. There you can implement your own custom logic for translating exceptions to validation errors. Notes: You should implement your own exception (to be able to distinguish it from IllegalArgumentException thorwn by other components). You can initialize WebDataBinder with your custom BindingErrorProcessor within your @InitBinder method (or set specific WebBindingInitializer to your handler adapter).

Categories : Spring

Include pre-encoded protocol buffer message within outer message
There is no a clean way, but there are a few hacky ways. One is to define a second message like this: message RawOuter { repeated bytes inners = 1; // ... same fields as Outer ... } RawOuter is identical to Outer except that the inners repeated field has been changed from type Inner to type bytes. If you populate inners with the encoded instances of Inner, then serialize the RawOuter, you get exactly the same result as if you had built an Outer with the parsed verisons. That is to say, the wire format for a nested message is identical to the wire format for a bytes field containing the serialization of that nested message. This is one of those funny exploitable quirks of the protobuf encoding. This hack has some problems, though. In particular, it doesn't work well if you'

Categories : C++

UInavigationcontroller Global Alert Message (like WhatsApp incoming message)
UINavigationBar is a subclass of UIView, so you can add subviews to it. And you can access it via the navigationController property on any of the view controllers or from wherever you have the UINavigationController retained. Just add your notification subview and remove it after a delay.

Categories : IOS

How do I send a message to a WSO2 Message Broker from a Node.js client
WSO2 Message Broker supports Advanced Message Queuing Protocol (AMQP) v0.91. I haven't tried this myself, but you should be able to use a Node.js client to connect with WSO2 MB. See amqp.node project at GitHub. You can connect with WSO2 MB using the AMQP connection URL. See the "Sending and Receiving Messages Using Queues" doc to understand how AMQP connection URL can be specified to connect with WSO2 MB. I hope this helps! Thanks!

Categories : Node Js

PHP mail returns true (Message accepted for delivery), but the message is not sent
That isn't all of the information from mail.log. You're seeing that the local server did accept your email, but it doesn't mention trying to send that email off to GMail. You could check the mail that is queued for delivery with $ mailq from the commandline. Chances are there are a few more lines in that log file with more information though.

Categories : PHP

Why am I getting "jquery.mobile-1.3.2.min.map file not found" message in Chrome
Probably your Google Chrome DevTools has enabled the option "Enable source maps". Check your Settings menu, then General and Sources. A source map file it's a way to map a combined/minified file back to an unbuilt state. When you build for production, along with minifying and combining your JavaScript files, you generate a source map which holds information about your original files. When you query a certain line and column number in your generated JavaScript you can do a lookup in the source map which returns the original location. Developer tools (currently WebKit nightly builds, Google Chrome, or Firefox 23+) can parse the source map automatically and make it appear as though you're running unminified and uncombined files. More information here.

Categories : Jquery

How in c++ create message similar to snprintf and just change value in message?
The "canonical" C++ way is to use stringstream, something like this: std::string somefunc(int number) { std::stringstream ss; ss << "You need " << number << " more coins"; std::string str = ss.str(); return str; }

Categories : C++

Is it possible for a message producer to get acknowledgement of message receipt from activemq?
Hope this would help to resolve your concern http://wso2.com/library/articles/2013/01/jms-message-delivery-reliability-acknowledgement-patterns/

Categories : Wso2

Posting BASE64 image and message via js API message is not UTF-8 encoded
We are posting a BASE64 image to a user album together with a status message No, you're posting the decoded binary data. Don't do that. Get rid of this line: imageData = Base64Binary.decode(encodedPng); and instead upload encodedPng as base64 data. Assuming the API is designed to handle base64 data, it should be fine. If it's not, and you really do need to upload the binary data, you shouldn't try to do that using form-encoded text.

Categories : Javascript

MVC 4 "Bug" Parameter Object Named "Message/message" will not be Deserialized
I guess you have a property called Message on your UserValidation class. This confuses the model binder because it first tries to match the posted values with the parameter names and only after that it moves to match the properties of the complex parameter types. In your case it sees a Message key in your posted data so it tries to match your whole UserValidation message parameter which will fail so the whole binding process stops and you get the null. I've only found some unofficial mentioning of this "feature": Default Model Binding: ActionMethod Parameter name must not equal Model Property name? MVC3 - Model Property Name and Action Parameter Name - Fight! So just use a different parameter name and it will work fine.

Categories : C#

protobuf message holding reference to another message of same type
I think this would do the trick: message Player { required string handle = 1; repeated Player neighbors = 2; } I compiled the definition with protobuf-c and it seems to be working.

Categories : C++

Creating a File-Like Object from email.message.Message
cStringIO was made specifically for this purpose. You can use StringIO if you need multiple encoding schemes,but cStringIO is MUCH faster. Example usage: import cStringIO test = cStringIO.StringIO() test.write("test") test.getvalue() >>> "test"

Categories : Python

Show a link to a path in a message form in c#
You can have an event for on-onclick, and then you can open file using the below code. System.Diagnostics.Process.Start(@"C:Work esult.txt"); //or like System.Diagnostics.Process.Start(@"C:Work esult.docx"); Here, the default program must be there for the file. Then only shell will run associated program reading it from the registry, like usual double click does in explorer.

Categories : C#

How do I debug the connection/message flow of my Chrome Sender Application?
To get some better insight as to the flow of getting a list of receivers, connecting/launching your application, and the messaging, it may be helpful to use Inspect the Background Page of the Google Cast Extension that you have installed into your browser. To do this: Open the Extensions page in Chrome (Settings -> Tools -> Extensions) Enable "Developer Mode" by checking the checkbox Find the Google Cast Extension in the list Click the link next to "Inspect views:" labelled "background.html" This should open a Chrome Inspector tab There is some logging done by the Extension itself. Additionally, by selecting the "Network" tab you can see the outgoing requests/responses and the WebSocket connection once initiated. After selecting the WebSocket connection, you can switch from the "Header

Categories : Google Chrome

Rails warning message after clicking a 3rd party link
Yes, you can achieve this by java script. http://www.codepotato.co.uk/2012/08/09/how-to-create-a-warning-when-opening-external-links-in-jquery/ answers your question.

Categories : Ruby On Rails

How to output an alert message when embedded link does not exist?
If you are allowed to read content from that domain you can do a HTTP HEAD request to see if the file exists: $.ajax({ url:'http://www.example.com/somefile.ext', type:'HEAD', error: function(){ //file does not exists }, success: function(){ //file exists } });

Categories : Javascript

powershell - link to attached file in mail message
This isn't really a PowerShell question, since this issue has nothing to do with the functionality of the Send-MailMessage cmdlet. In any case, the reason you can't find a solution anywhere is that what you're trying to do is impossible. There is no way that a hyperlink in an e-mail message can point to a file attached to that message. Different mail clients on different operating systems store attachments in different locations. Even if you want to assume that all your recipients are running Outlook on Windows, there are different versions of both. Even if you know for a fact that all recipients are running a specific version of Outlook on a specific version of Windows, you're still out of luck. Outlook stores attachments in a subfolder in the Temporary Internet Files in the user's profi

Categories : Powershell



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.