This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Kevin Cannon
Posted Jan 28 - Read on Facebook

Is there a way to globally disable the print command, so that I can disable it when mirroring it to my mobile? It’s ruining my prototypes :)


Andreas Wahlström

You can temporarily override the print function at the top of your document:
print = () -> return

Andy Jakubowski

You could also create your own function and only print things if a condition is met (e.g. not mobile browser):

I don’t need that normally, but I use a flag for dev and presentation purposes:

isLogging = yes

log = (message) ->
if isLogging then print message

log("Print me please")

Andreas Wahlström

Theres also a Utils.isMobile() boolean that you can use in andys function above :)

Mike Feldstein

reallyPrint = print
print = (m) -> if !Utils.isMobile() then reallyPrint (m)

Kevin Cannon

All great tips guys - ended up with a combination of all of the above.

log = (content) ->
if isLogging
print content

if Utils.isMobile()
isLogging = false
isLogging = true

Read the entire post on Facebook