I'm new in JavaScript and wish to create something that can help my company to do some automated work.
I am creating a chrome extension to trace time in motion of my colleagues dairy work on the browser.
Basically the chrome extension will capture userName and click event and submitting to Office 365 Excel form by using URL Query String window.open(URL&userName) and setAttributes("Value", userName) then getElementbyId("button").click() to submit the form, but it unable to pass thru as the value will be reset and error will show "the answer is required"
Anything I missed out?
document.getElementsByClassName("office-form-question-textbox office-form-textfield-input form-control border-no-radius")[0].setAttribute("value","CCC")
document.getElementsByClassName("button-content")[7].click()
these are 2 line code i ran in javascript.
ExcelFrom Image
I found solution for Google Form to silent submission.and i wish to make it work with Office 365 Excel Form.
Thanks.
Related
I want to prepare a Chrome Extension for my password manager program. The password manager program keeps the usernames and passwords encrypted locally and is therefore not on any server. Instead of copying and pasting every time, I send the usernames and passwords to the Google address line as follows:
https://stackoverflow.com/users/login?user_name=USERNAME&password=PASSWORD
I want the Google Extension to automatically add the username and password in the address line to the corresponding textboxes. Unfortunately, I have no idea for this. I downloaded and reviewed Google Extensions like Daslane, but they are all very complicated and I could not understand. Your ideas and examples, if possible, on how to do this very simply are very valuable for me.
First you need to find simple chrome extension sample code.
This is the simple source from chrome developer page.
After that, you have to detect the control name using chrome developer tool and use this script to auto fill and click login button.
function AutoFill() {
var html = window.location.href + "\n\n";
if (html.includes("example.com") == true)
{
document.getElementById("username").value = "username"
document.getElementById("password").value = "password"
document.getElementsByName("login")[0].click();
}
return html;
}
chrome.extension.sendRequest(AutoFill());
To fill the form on the document you need access to the document. You can use for this content scripts - https://developer.chrome.com/extensions/content_scripts
I'm not sure why you would like to pass credentials via URL. I think it is a bad practice and it can break website behavior. It is better to get credentials from background script - https://developer.chrome.com/extensions/background_pages
Communication between content script and background page can be implemented via chrome.runtime.onMessage event.
If you really need to get parameters from URL, you can do this in the content script by using URLSerachParams - https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
Example:
var url = new URL(location.href);
console.log(url.searchParams.get('user_name'));
Is it possible to getting verification sms code from browser(javascript) application ( autoincrement || auto filling)?
There are article that on ios 12 safari appeared the function auto filling sms verification code (2fa). But i can't find description(html5 or javascript) how does this work?
UPD
it's work well in safari:
<input type="tel" id="single-factor-code-text-field" autocomplete="one-time-code">
I was find apple documentation for this feature
https://developer.apple.com/documentation/security/password_autofill/enabling_password_autofill_on_an_html_input_element
I did not try it yet. But i thing it works only with secret key from clipboard. When you you tap to sms with code, ios suggest you copy code to clipboard.
It seems that the iOS autofill for 2FA is a bit of a mystery. Apple haven't documented a particular way to ensure this works. I had a search around to try to see if there was a specific HTML attribute you could use to ensure the device tries to fill in with the code, but I couldn't find anything.
As far as I can tell, Safari runs some heuristics on your page and on incoming SMS messages and if a code is found in the SMS and the page appears to have an input for a code then it offers the autofill. If you are looking to ensure this works on your site, I recommend inspecting the HTML of another site that you have seen it work on and use similar names for the input field.
I have been trying to:
Go to:
mdoe.state.mi.us/moecs/PublicCredentialSearch.aspx
Enter a certificate number (for the sake of illustration, you can just search for "Davidson" as the last name).
Click on a link corresponding to "Professional Teaching Certificate".
Copy and paste the resulting table.
The rub seems to be with the JavaScript doPostBack() part, as it requires rendering, I believe, to get the data.
When viewing the source code, see how the href part identifies an individual link like this? (for the 6th link down):
href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$gViewCredentialSearchList$ctl07$link1','')
From this:
<td class="MOECSNormal" style="border-color:Black;border-width:1px;border-style:Solid;">Professional Teaching Certificate Renewal</td><td class="MOECSNormal" style="border-color:Black;border-width:1px;border-style:Solid;">
<a id="ContentPlaceHolder1_gViewCredentialSearchList_link1_5" ItemStyle-BorderColor="Black" ItemStyle-BorderStyle="Solid" ItemStyle-BorderWidth="1px" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$gViewCredentialSearchList$ctl07$link1','')">CC-XWT990004102</a>
</td>
I'm looking for a way (via Python) to get the data I need into a table, given a certification number and certificate name (i.e. "Professional Teaching Certificate".
I have tried following a tutorial using PyQt4, but installing it alone was traumatic.
Thanks in advance!
You can open the page in a browser e.g. Chrome and study how the interaction is done between the page and the server, normally this information can be seen in the network tab of Developer tool, this way you can formulate a python script to do the steps maybe using requests library
or
You can use selenium-python to do simulate your browser interaction (including javascript calls) until you got to the page where your interested data belongs to.
I develop an addon for Firefox and have the next question: is there a way to paste data from clipboard to borwser elements like a search or url field using Firefox addon api? And what is the best way to solve such kind of problem?
Yes get the data on the clipboard with: paste data from clipboard using document.execCommand("paste"); within firefox extension
Then do Services.wm.getMostRecentWindow('navigator:browser').gURLBar.value = varHoldingPasteData;
MS CRM 2011 on premise.
No problems if accessed via internal address: crm:5555
Go to crm.ourcompany.co.uk:5555 in IE and load account page and the ribbon is totally grey. (Not disabled - every pixel is the colour grey.)
In Chrome and Firefox the ribbon is loaded fine.
Browser console in IE, Chrome and FF all say access errors.
I can see they are trying to access crm:5555.
IE says:
SCRIPT5: Access is denied.
PageLoader.js, line 1 character 1226
The second line above is presented as a link. Clicking it shows me this: http://pastebin.com/bBadk9HS
The full path is http://crm.ourcompany.co.uk:5555/_static/_common/scripts/PageLoader.js?ver=-1056260279
P.S. IE is "Browser Mode: IE10 Document Mode: IE9 standards".
After Long investigation I have found out the reason for same issue like this.
We had previous rollup activity feed solution.
After importing the new version of Activity feeds this hectic issue was sorted out.
Activity feed new solution is available with rollup up package.it can be found by exacting the rollup package. Previously this was available in Microsoft Dynamic market place.
It turns out that the problem is an address lookup plugin on the Account form.
This is trying to access http://crm:1999, which is a 404, and http://crm:5555, which isn't allowed.
Solutions are to fix the server on http://crm:1999 and set up proper managed internal and external URLs so it'll know whether http://crm:5555 or http://crm.ourcompany.co.uk:5555 or remove the plugin.