Forum Discussion

_anomDiebolt_'s avatar
_anomDiebolt_
Qrew Elite
8 years ago

New Technique: New WIndow

I wanted to pass on a new technique that some of you might find useful. Let's call this technique the New Window technique.

When I created the repeating headers script I used this technique to grab QuickBase's report print page and modify it before displaying it.

Custom Repeating Headers On Printed Records
https://community.quickbase.com/quickbase/topics/custom-repeating-headers-on-printed-reports

I haven't released the code for that mini-project because it is a small mess but a can show you how I arranged things. Let's do it through a short demo:

Visit this public page:

Formula Function Reference ~ All Functions and Operators
https://login.quickbase.com/db/6ewwzuuj?a=q&qid=6

Now press F12 to expose the devtools and paste in this code into the consle:

$.ajaxSetup({async: true});
var url = "https://login.quickbase.com/db/6ewwzuuj?a=q&qid=6";
var markup;
$.get(url, function(html) {
  markup = html.replace(/Formula Functions Reference/g, "Monadic Pipeline Workflow Reference");
});
 
var win = window.open();
win.document.open();
win.document.write(markup);
win.document.close();
win.history.pushState({}, "All Functors", url);

Here is a screenshot of me applying the code manually from the above URL:



And here is a screenshot of the window that loads annotated to show the two modifications I made to the page:



Now it is obvious that we changed the text "Formula Functions Reference" to the text, "Monadic Pipeline Workflow Reference" but what's changed about the URL?

Well the script actually opens a new window without a URL so what would be shown in the address bar is about:blank. However the code actually sets the URL and changes the title of the page to "All Functors" with the last line of code using pushState():
win.history.pushState({}, "All Functors", url);

Well there you go yet another way to customize QuickBase's pages. This worked well for modifying QuickBase report to have Custom Repeating Headers and I am sure you will find clever uses as well.
No RepliesBe the first to reply